Informatica Parameter Name in text file
Hello All, We have a mapping variable $$LAST_EXPRACT_DATE and set it as SETMAXVARIABLE($$LAST_EXTRACT_DATE,TIME_ID), it's working fine and having max value in $$LAST_EXTRACT_DATE variable. Now we want to generate parameter file like $$LAST_EXTRACT_DATE=<$$LAST_EXTRACT_DATE value> For that we have given below post session success command.echo $$LAST_EXTRACT_DATE=$$LAST_EXTRACT_DATE > filename.txt and we are getting output like <$$LAST_EXTRACT_DATE value>=<$$LAST_EXTRACT_DATE value>
That is obvious and output is correct, how do we achive this output as we want a variable name in file ?$$LAST_EXTRACT_DATE = <$$LAST_EXTRACT_DATE value>
Please advice... Thanks,Dipak
ヘ 마카오카지노여행 ¡ top015。ℂℴℳ 【Ƹ̵̡Ӝ̵̨̄Ʒ】 마카오카지노여행 ヘ 온라인 추천ヘ 마카오카지노여행 ¡ top015。ℂℴℳ 【Ƹ̵̡Ӝ̵̨̄Ʒ】 마카오카지노여행 ヘ 온라인 추천 ヘ 마카오카지노여행 ¡ top015。ℂℴℳ 【Ƹ̵̡Ӝ̵̨̄Ʒ】 마카오카지노여행 ヘ 마카오카지노여행 ¡ top015。ℂℴℳ 【Ƹ̵̡Ӝ̵̨̄Ʒ】 마카오카지노여행 ヘ 마카오카지노여행 ¡ top015。ℂℴℳ 【Ƹ̵̡Ӝ̵̨̄Ʒ】 마카오카지노여행 ヘ 마카오카지노여행 ¡ top015。ℂℴℳ 【Ƹ̵̡Ӝ̵̨̄Ʒ】 마카오카지노여행 ヘ 마카오카지노여행 ¡ top015。ℂℴℳ 【Ƹ̵̡Ӝ̵̨̄Ʒ】 마카오카지노여행 ヘ 마카오카지노여행 ¡ top015。ℂℴℳ 【Ƹ̵̡Ӝ̵̨̄Ʒ】 마카오카지노여행 ヘ 마카오카지노여행 ¡ top015。ℂℴℳ 【Ƹ̵̡Ӝ̵̨̄Ʒ】 마카오카지노여행 ヘ 마카오카지노여행 ¡ top015。ℂℴℳ 【Ƹ̵̡Ӝ̵̨̄Ʒ】 마카오카지노여행 ヘ 마카오카지노여행 ¡ top015。ℂℴℳ 【Ƹ̵̡Ӝ̵̨̄Ʒ】 마카오카지노여행 ヘ 마카오카지노여행 ¡ top015。ℂℴℳ 【Ƹ̵̡Ӝ̵̨̄Ʒ】 마카오카지노여행 ヘ 마카오카지노여행 ¡ top015。ℂℴℳ 【Ƹ̵̡Ӝ̵̨̄Ʒ】 마카오카지노여행 ヘ 마카오카지노여행 ¡ top015。ℂℴℳ 【Ƹ̵̡Ӝ̵̨̄Ʒ】 마카오카지노여행 ヘ 마카오카지노여행 ¡ top015。ℂℴℳ 【Ƹ̵̡Ӝ̵̨̄Ʒ】 마카오카지노여행 ヘ 마카오카지노여행 ¡ top015。ℂℴℳ 【Ƹ̵̡Ӝ̵̨̄Ʒ】 마카오카지노여행 ヘ 마카오카지노여행 ¡ top015。ℂℴℳ 【Ƹ̵̡Ӝ̵̨̄Ʒ】 마카오카지노여행 ヘ 마카오카지노여행 ¡ top015。ℂℴℳ 【Ƹ̵̡Ӝ̵̨̄Ʒ】 마카오카지노여행 ヘ 마카오카지노여행 ¡ top015。ℂℴℳ 【Ƹ̵̡Ӝ̵̨̄Ʒ】 마카오카지노여행 ヘ 마카오카지노여행 ¡ top015。ℂℴℳ 【Ƹ̵̡Ӝ̵̨̄Ʒ】 마카오카지노여행 ヘ 마카오카지노여행 ¡ top015。ℂℴℳ 【Ƹ̵̡Ӝ̵̨̄Ʒ】 마카오카지노여행 ヘ 마카오카지노여행 ¡ top015。ℂℴℳ 【Ƹ̵̡Ӝ̵̨̄Ʒ】 마카오카지노여행 ヘ 마카오카지노여행 ¡ top015。ℂℴℳ 【Ƹ̵̡Ӝ̵̨̄Ʒ】 마카오카지노여행 ヘ 마카오카지노여행 ¡ top015。ℂℴℳ 【Ƹ̵̡Ӝ̵̨̄Ʒ】 마카오카지노여행 ヘ 마카오카지노여행 ¡ top015。ℂℴℳ 【Ƹ̵̡Ӝ̵̨̄Ʒ】 마카오카지노여행 ヘ 마카오카지노여행 ¡ top015。ℂℴℳ 【Ƹ̵̡Ӝ̵̨̄Ʒ】 마카오카지노여행 ヘ 마카오카지노여행 ¡ top015。ℂℴℳ 【Ƹ̵̡Ӝ̵̨̄Ʒ】 마카오카지노여행 ヘ 마카오카지노여행 ¡ top015。ℂℴℳ 【Ƹ̵̡Ӝ̵̨̄Ʒ】 마카오카지노여행 ヘ 마카오카지노여행 ¡ top015。ℂℴℳ 【Ƹ̵̡Ӝ̵̨̄Ʒ】 마카오카지노여행 ヘ 마카오카지노여행 ¡ top015。ℂℴℳ 【Ƹ̵̡Ӝ̵̨̄Ʒ】 마카오카지노여행 ヘ 마카오카지노여행 ¡ top015。ℂℴℳ 【Ƹ̵̡Ӝ̵̨̄Ʒ】 마카오카지노여행
Similar Messages
-
VB Script to accept PC names in text file and get registry key value out of those systems
Hi All,
My task: Create VB script to accept PC names from a text file, process each host name to get Registry key value of individual host name and finally export them to a text file or an excel sheet having registry key value against each pc.
I want to pull key value of LSFORCEHOST located in HKCU/Environment of each PC and export this value against each pc in a text or Excel file.
What I achieved: I am able to process against single pc name but failed to process 3000+ systems listed in a text file which I tried to process through VB script. I am not pro and learning the VBS and cant write complex code.
My VBS code written so far(It failed many time with issue):
Option Explicit
Const HKEY_CURRENT_USER = &H80000001
Dim oFSO, sFile, oFile, sText, strComputer,oReg, strKeyPath, strValueName, strValue, objFSO, objFile, strContents
Set oFSO = CreateObject("Scripting.FileSystemObject")
sFile = "test.txt"
If oFSO.FileExists(sFile) Then
Set oFile = oFSO.OpenTextFile(sFile, 1)
Do While Not oFile.AtEndOfStream
sText = oFile.ReadLine
If Trim(sText) <> "" Then
strComputer = sText
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
strComputer & "\root\default:StdRegProv")
strKeyPath = "Environment"
strValueName = "LSFORCEHOST"
oReg.GetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName,strValue
Const ForReading = 1
Const ForWriting = 2
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("C:\destination.txt",1, ForReading)
strContents = strValue
Set objFile = objFSO.OpenTextFile("C:\destination.txt",2, ForWriting)
objFile.Write strContents
objFile.Close
End If
Loop
oFile.Close
End If
I think when I tried to process each PC name from text file against registry key value, above code not working. As per my knowledge some issue in loop. Do I need to add FOR EACH feature?
Please help to correct it. Thanks in advance.I think when I tried to process each PC name from text file against registry key value, above code not working. As per my knowledge some issue in loop. Do I need to add FOR EACH feature?
Please help to correct it. Thanks in advance.
Your code contains numerous errors. Furthermore you make things difficult for yourself by giving similar names to the objects used for your input and output. If you are a systems administrator then your best bet is to make an effort to learn the language
instead of grabbing a few code fragments from here and there and hoping that somehow they will work.
Try the cleaned up code below for this particular project. Note the consistent code indentation. It helps you enormously when trying to understand the structure of the code. Remember also that you must fully qualify all file paths. Writing to "Destination.txt"
will cause endless confusion because you never know for sure where this file will reside.
Const HKEY_CURRENT_USER = &H80000001
Set oFSO = CreateObject("Scripting.FileSystemObject")
sKeyPath = "Environment"
sValueName = "LSFORCEHOST"
sFile = "D:\Test.txt"
If oFSO.FileExists(sFile) Then
Set oInput = oFSO.OpenTextFile(sFile, 1)
Do While Not oInput.AtEndOfStream
sComputer = oInput.ReadLine
If Trim(sComputer) <> "" Then
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" _
& sComputer & "\root\default:StdRegProv")
oReg.GetStringValue HKEY_CURRENT_USER,sKeyPath,sValueName,sValue
Set oOutput = oFSO.OpenTextFile("D:\destination.txt",8, True)
oOutput.WriteLine sValue
oOutput.Close
End If
Loop
oInput.Close
End If -
How to redirect "-verbose" Java Runtime Parameter setting to text file
Simple question: I am adding a "-verbose" Java Runtime Parameter in the Java Applet Runtime Settings of the Java Control Panel. When I run my applet, a Windows console opens which outputs all the method calls, classes, and jar file information. How can I redirect this output to a text file?
I noticed Xloggc:+filename+ but there does not seem to be an equivalent for redirecting the '-verbose' output to a file.
Thanks!
Edited by: zillius on Dec 14, 2007 1:47 PMThank you both for the reply, but unfortunately that is not quite what I am looking for. The console Window I am talking about is a DOS console screen, not the Java Console
What I am really after here is the ability to redirect a thread dump of a running applet to a text file. When the applet is active, and the "-verbose" parameter is set in the Java Runtime Parameters", I can see all the classes, methods etc. being loaded in the DOS window. Hitting Ctrl-Break at that point will produce a thread dump in the DOS console screen. I would like to be able to redirect THAT output to a text file. It is not in the Java Console. To me it looks like tracing and logging are only for the Java Console, no?
Thanks again for your help.
Edited by: zillius on Dec 19, 2007 7:17 AM -
Write to measurement file, adding column name in text file.
Hello,
Is it possible to add own column name for a text file using Write to measurement file function?
In the created file I have three different columns (I want to name them Time/Voltage/Date&Time).
Maby I should choose different write option like write to spreadsheet?You are going to have to post some actual code if you want us to help here. Otherwise it is a complete shot in the dark. Posting an example CSV file of what you have and what you want would also be beneficial.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines -
How to add name from text file to jtable?
hello all,
how to add name (string) from the notepad file(.txt) into jTable rows.
I am not able to add it.
try {
FileInputStream fis = new FileInputStream("Devices/Devices_Lst.txt");
BufferedReader br = new BufferedReader(new InputStreamReader(fis));
String line = null;
Vector data = new Vector();
line = br.readLine();
while ( (line = br.readLine()) != null)
int rowCount1 = nmsTable.getRowCount();
for(int i=0;i<rowCount1;i++)
myTableInit(); // it initialize the table
/* nmsTable.setValueAt(i+1,i,0);
Table.setValueAt(line,i,1);
Table.setValueAt(" ",i,2);
Table.setValueAt(" ",i,3);
Table.setValueAt(" ",i,4);
Table.setValueAt(" ",i,5); */
int rowNo = nmsTable.getRowCount();
row.addElement((rowNo+1));
//row.addElement(ipText.getText()+"-"+nameText.getText());
row.addElement(line);
row.addElement((String)" ");
row.addElement((String) "");
row.addElement((String) "");
row.addElement((String) "");
row.addElement((String) "");
rows.add(row); //rows is the Vector for table row.
Table.addNotify();
br.close();
if possible give me some examples.
thank you.For every row you need to create a new Vector and add the data to that Vector. Then the Vector is added to the TableModel.
If you add 6 items to the single Vector, then you will get 6 columns. So you need to create 6 Vectors and add a single item to each Vector and therefore you will end up with 6 rows with 1 column of data. -
Hi
suppose in text file the data is
No Name
1 abc
2 xyz
and a table st_rec that has attribute no and name and i want populate my form field that are no and name with text file data and populate i can store this data into database.
how i can....
Thanks in advanceyou can use sqlloader which is shipped with your Developer.
-
Reading Tab Delimited Text File
HI
I am having problem in reading Tab Delimited text file.
If i place some spaces in name of text file. it dosn`t read the file.
if there is a simple name without space, then it reads easily.
but when having space in file name then it shows nothing.
PLZ help me .......
give me some code or links to solution
thanks!Could you post up an example of the file? With a FedEx report file, I created an application to read each line and split the String into an array where ever a [tab] exists. Since the columns aren't evenly tabbed, I used a regular expression to replace any whitespace in a with a \t (tab). Now it takes that line and splits it into an array where the [tab] exists. Then I access that specific column in the String by line.
08/28/2007 FedEx Ground COLO2
23:16:29 LANE FULL REPORT reptClaneFulls
Page 1
Next Sorters
Load Main Auto Smalls
Chute Point Primary Secondary Primary Secondary
0101 8001 0 11 0 0
0102 5333 0 9 0 0
0104 0142 0 441 0 0
0106 0328 0 5 0 0
0107 0452 0 2 0 0
0110 0333 0 2 0 0
0113 0447 0 7 0 0
0114 0447 0 1 0 0
0115 0303 0 11 0 0
0127 0132 0 2 0 0
0128 0132 0 11 0 0
0129 0132 0 9 0 0
0130 0405 0 102 0 0
0131 0371 0 270 0 0
0132 0371 0 168 0 0
0133 0122 0 13 0 0
0134 0456 0 36 0 0
0135 0146 0 152 0 0
0136 0146 0 2 0 0
0138 0371 0 24 0 0
0201 0552 0 9 0 0
0204 0445 0 69 0 0
0205 0445 0 51 0 0
0207 0641 0 1 0 0
0211 0551 0 1 0 0
0212 0454 0 7 0 0
0213 3441 0 39 0 0
0216 0841 0 1 0 0
0217 0631 0 211 0 0
0222 0441 0 12 0 0
0223 0 5 0 0
0224 0441 0 9 0 0
0225 0441 0 42 0 0
0226 0441 0 11 0 0
0227 0441 0 5 0 0
0229 0619 0 753 0 0
0230 0619 0 188 0 0
0231 0602 0 2 0 0
0232 0604 0 91 0 0
0233 0604 0 3 0 0
0238 0601 0 1 0 0
0304 1435 0 12 0 0
0307 2430 0 477 0 0
0309 1430 0 98 0 0
0310 1430 0 1 0 0
0311 0971 0 1 0 0
0312 0449 0 19 0 0
0313 0449 0 128 0 0
0315 0923 0 31 0 0
0316 0981 0 11 0 0
0317 0972 0 9 0 0
08/28/2007 FedEx Ground COLO2
23:16:29 LANE FULL REPORT reptClaneFulls
Page 2
Next Sorters
Load Main Auto Smalls
Chute Point Primary Secondary Primary Secondary
0318 0972 0 6 0 0
0319 2431 0 1 0 0
0323 0436 0 9 0 0
0324 0 3 0 0
0326 3431 0 12 0 0
0328 0958 0 55 0 0
0332 0430 0 84 0 0
0333 0430 0 16 0 0
0334 4430 0 29 0 0
0337 0480 0 2 0 0
0343 0555 0 36 0 0
0405 1437 0 52 0 0
0406 1437 0 51 0 0
0407 3152 0 58 0 0
0408 3152 0 2 0 0
0410 0152 0 5 0 0
0411 0152 0 3 0 0
0415 0100 0 55 0 0
0417 0253 0 95 0 0
0420 0282 0 1 0 0
0421 0282 0 82 0 0
0422 0753 0 13 0 0
0425 0165 0 9 0 0
0426 0165 0 8 0 0
0427 0089 0 21 0 0
0428 0089 0 10 0 0
0434 0437 0 3 0 0
0436 0170 0 4 0 0
0441 0263 0 9 0 0
0442 0219 0 1 0 0
0443 0219 0 20 0 0
0444 3258 0 3 0 0
0447 0156 0 89 0 0
0448 0156 0 59 0 0
0449 0156 0 1 0 0
0450 0760 0 14 0 0
0451 3163 0 16 0 0
0453 0212 0 27 0 0
0454 7760 0 2 0 0
107A 0219 0 0 0 88
108A 0219 0 0 0 89
110A 7061 0 0 0 185
111A 7061 0 0 0 190
112A 0170 0 0 0 3
113A 0170 0 0 0 1
114A 0170 0 0 0 3
118A 0089 0 0 0 261
119A 0089 0 0 0 255
120A 0282 0 0 0 5
121A 0282 0 0 0 4
122A 0753 0 0 0 6
08/28/2007 FedEx Ground COLO2
23:16:29 LANE FULL REPORT reptClaneFulls
Page 3
Next Sorters
Load Main Auto Smalls
Chute Point Primary Secondary Primary Secondary
124A 3156 0 0 0 258
125A 0258 0 0 0 74
126A 3258 0 0 0 3
127A 0263 0 0 0 34
128A 3263 0 0 0 7
129A 0152 0 0 0 39
130A 0152 0 0 0 44
131A 0152 0 0 0 33
132A 3152 0 0 0 176
133A 3152 0 0 0 181
134A 0253 0 0 0 34
135A 0253 0 0 0 34
136A 3253 0 0 0 103
137A 0156 0 0 0 85
138A 0156 0 0 0 87
139A 0437 0 0 0 271
140A 3437 0 0 0 111
141A 0165 0 0 0 204
142A 3165 0 0 0 5
143A 0163 0 0 0 9
144A 3163 0 0 0 5
147A 7760 0 0 0 9
201A 8001 0 0 0 1
202A 8001 0 0 0 2
205A 3435 0 0 0 62
206A 0402 0 0 0 218
208A 0405 0 0 0 15
212A 0411 0 0 0 5
213A 0411 0 0 0 5
214A 3441 0 0 0 224
215A 3441 0 0 0 225
216A 0410 0 0 0 9
217A 0449 0 0 0 49
218A 0449 0 0 0 51
219A 3452 0 0 0 12
220A 0452 0 0 0 4
221A 0452 0 0 0 6
222A 3431 0 0 0 33
223A 3431 0 0 0 38
224A 2430 0 0 0 14
225A 2430 0 0 0 14
226A 4430 0 0 0 15
227A 4430 0 0 0 15
228A 0430 0 0 0 4
229A 0430 0 0 0 4
230A 1430 0 0 0 11
231A 1430 0 0 0 23
232A 0456 0 0 0 96
233A 7433 0 0 0 9
234A 0333 0 0 0 3
235A 7641 0 0 0 10
08/28/2007 FedEx Ground COLO2
23:16:29 LANE FULL REPORT reptClaneFulls
Page 4
Next Sorters
Load Main Auto Smalls
Chute Point Primary Secondary Primary Secondary
236A 0802 0 0 0 5
240A 0631 0 0 0 111
241A 0551 0 0 0 3
245A 0958 0 0 0 71
246A 0554 0 0 0 72
247A 0923 0 0 0 48
248A 0371 0 0 0 31
249A 0972 0 0 0 49
250A 0381 0 0 0 3
251A 0619 0 0 0 27
253A 0604 0 0 0 48
254A 0132 0 0 0 57
255A 0132 0 0 0 53
257A 0942 0 0 0 16
307A 0951 0 0 0 138
308A 0464 0 0 0 22
309A 0641 0 0 0 45
310A 0641 0 0 0 47
311A 0122 0 0 0 16
312A 0971 0 0 0 76
313A 0602 0 0 0 37
314A 0841 0 0 0 9
315A 0841 0 0 0 8
317A 0958 0 0 0 2
318A 0532 0 0 0 35
320A 0604 0 0 0 16
322A 0981 0 0 0 90
323A 0371 0 0 0 42
324A 0972 0 0 0 13
325A 0372 0 0 0 35
326A 0928 0 0 0 14
327A 0619 0 0 0 78
328A 0328 0 0 0 17
330A 0303 0 0 0 27
331A 0923 0 0 0 1
332A 0336 0 0 0 3
333A 7850 0 0 0 7
335A 0146 0 0 0 8
337A 0454 0 0 0 20
338A 3445 0 0 0 86
339A 0445 0 0 0 371
340A 1441 0 0 0 42
341A 2442 0 0 0 111
342A 0441 0 0 0 59
343A 1442 0 0 0 23
344A 0442 0 0 0 28
345A 7441 0 0 0 66
346A 4441 0 0 0 73
347A 2441 0 0 0 72
348A 3462 0 0 0 12
349A 0462 0 0 0 62
08/28/2007 FedEx Ground COLO2
23:16:29 LANE FULL REPORT reptClaneFulls
Page 5
Next Sorters
Load Main Auto Smalls
Chute Point Primary Secondary Primary Secondary
350A 0447 0 0 0 36
351A 0447 0 0 0 43
352A 3468 0 0 0 2
353A 0468 0 0 0 13
354A 0142 0 0 0 26
356A 0436 0 0 0 7
357A 0436 0 0 0 5
359A 0480 0 0 0 20
RLBL 0 47 0 0
SSBL 0 127 0 0
SSGN 0 32 0 0
SSRD 0 323 0 0
======================================================
TOTAL: 0 5071 0 6630 -
How to export app list in iTunes to csv or text file?
How to export an app list in iTunes libtary to csv,text, or Excel compatable file format?
Hi Peter,
I found out what caused the Script not running on CS3. In my workstation, there are multiple versions of ExtendScript Toolkit (cs, 2 and CS4). When I am working on the Script it default to the latest version which is ExtendScript Toolkit CS4, so it will refer to CS4, activate and launch CS4.
After pulling my hair finding the cause. I finally search and found ExtendScript Toolkit 2 which work for CS3. I shut down ExtendScript Toolkit CS4 and test the same exact Script . It works perfectly. So if you try to run this Script on CS3. Make sure at the prompt message to see if it will run on Adobe InDesign CS3, then it will run fine. In reverse, if you run the Script on CS4, make sure to check your ExtendScript Toolkit CS4 otherwise it will do nothing like I experienced. Great!
Below is my final code for the Script. This Script will capture all link elements' name as text file so I can search batch of elements from the central server for all pick up logos, images, artworks... to prep for my page assembly workflow. Hope this will help anyone have the same interest. All credit to Peter. Thank for all your help and support.
#target indesign;
try
link_name = app.documents[0].links.everyItem().name;
var f = app.documents.add ().textFrames.add ();
f.geometricBounds = [0.5,0.5,"266mm","203mm"];
f.contents = link_name.sort (caseless).join ("\r");
catch (_){}
function caseless (a, b)
return a.toLowerCase() > b.toLowerCase()
Kenn Nguyen -
Reading String (Name-Value) from text file into XML
Hi,
I have a requirement for reading a text file and converting each entry of that text file into XML format. I have not came across such thing yet so looking for some ideas. I am using SQL Server 2005 and here is a sample entry from my source text file,
Jun 4 14:31:00 zzzz64x02 fff:
INPUT(ty=XYZ,Prefix=15063,dn=78787878787878,sgk=100.139.201.48,xxn=87878,ani=656565656565,ogrp=F7ZX05,ogtxt=NNNNN,ogx=NNNNN,oci=0xe00ac,ogi={NOA=INT,BC=1,SIG-TYPE=ZIP});
PROCESS(ty=0x100000,cu=32880,Name=XOXOXOX,pc=88017,pd=24,dd=880175,pk=880175,rd=115472,ca=BGD,reg=RW,cdp=1,ai=245359,grp=2648,sl=9);
OUTPUT(ty=XXXX,ret=0,rl=
{i=1,su=99999,rizID=61084,skid=06,truckgp=1084,dd=8801,dn=78787878787878}
I will get multiple entries like this in my source text file which I have to convert into XML (using TSQL).
Any help will be useful.
Regards.
'In Persuit of Happiness' and ..... learning SQL.And I'm telling you that this is a bad option. You would use the vaccum cleaner to wash the dishes, would you?
If you for some reason would do this task in SQL Server, you would implement it as a CLR stored procedure, but from what you have said I don't understand why you would do this server-side at all.
What's wrong with the current C# solution?
Erland Sommarskog, SQL Server MVP, [email protected]
Got it. I was just looking for the available options, nothing wrong with my C# solution. And yes, I don't use vacuum cleaner to wash dishes.
'In Persuit of Happiness' and ..... learning SQL. -
Importing text file (with file names) into Automator.. is it possible?
Hello all,
I have been working with Windows Batch files for my line of work. I have a couple of file names in a text file (a column), which I want to copy from one folder of one hdd to another folder on a different hdd. I have been trying to do this kind of work with a Mac. I already know how you copy and rename files in automator (which isn't difficult, of course) but you have to 'select' the files in the finder first (with get specified items).
But the only way i see that you can specify items is by selecting them... is there a way to import a text file with all the file names instead of selecting all the file names manually?
or is there an AppleScript alternative which I can use to import the text file (or just copy into applescript) and run before the query's of copying and renaming the files? I am kind of new to Apple programming.
The text file looks like this:
image1.jpg
image2.jpg
etc..
so there has to be a command to: 'goto' a specific folder as well.
Thanks in advance!You can import text files, but if they are just names you will need an additional action to add the source folder path. A *Run AppleScript* action can be used, for example:
Tested workflow:
1) *Ask for Finder Items* {Type: files } -- choose the text file containing the names
2) *Combine Text Files* -- this gets the text file contents
3) *Filter Paragraphs* { return paragraphs that are not empty } -- skip blank lines
4) *Run AppleScript* -- copy and paste the following script:
<pre style="
font-family: Monaco, 'Courier New', Courier, monospace;
font-size: 10px;
font-weight: normal;
margin: 0px;
padding: 5px;
border: 1px solid #000000;
width: 680; height: 340px;
color: #000000;
background-color: #FFEE80;
overflow: auto;"
title="this text can be pasted into an Automator 'Run AppleScript' action">
on run {input, parameters} -- add folder path
add the specified folder path to a list of file names
input: a list of text items (the file names)
output: a list of file paths (aliases)
set output to {}
set SkippedItems to {} -- this will be a list of skipped items (errors)
set SourceFolder to (choose folder with prompt "Choose the folder containing the file names") as text -- this is the folder containing the names
repeat with AnItem in the input -- step through each name in the input
try
set AnItem to SourceFolder & AnItem -- add the prefix
set the end of the output to (AnItem as alias) -- test
on error number ErrorNumber -- oops
set ErrorNumber to (" (" & ErrorNumber as text) & ")" -- add the specific error number
set the end of SkippedItems to (AnItem as text) & ErrorNumber
end try
end repeat
ShowSkippedAlert for SkippedItems
return the output -- pass the result(s) to the next action
end run
to ShowSkippedAlert for SkippedItems
show an alert dialog for any items skipped, with the option to cancel the workflow
parameters - SkippedItems [list]: the items skipped
returns nothing
if SkippedItems is not {} then
set {AlertText, TheCount} to {"Error with AppleScript action", count SkippedItems}
if TheCount is greater than 1 then
set theMessage to (TheCount as text) & space & " items were skipped:"
else
set theMessage to "1 " & " item was skipped:"
end if
set {TempTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, return}
set {SkippedItems, AppleScript's text item delimiters} to {SkippedItems as text, TempTID}
if button returned of (display alert AlertText message (theMessage & return & SkippedItems) ¬
alternate button "Cancel" default button "OK") is "Cancel" then error number -128
end if
return
end ShowSkippedAlert
</pre>
5) *Copy Finder Items* { To: _your external drive_ } -
Importing Text file in to iTunes with song and artist names
A friend made a compilation CD for me. He exported the artist and song names in to a text file from iTunes. I am having trouble importing the information in to my itunes. The people at the apple store said that it was not possible and that I would have to import his whole iTunes library.
Thanks.
imacHi Dennis,
In order to import flat files into MDM do the following. This solution is specific to MS Windows:
I. Set up ODBC for *.txt or *.csv files
1. Open Data Sources (ODBC) interface:
Start> Settings> Control Panel--> Administrative Tools -->Data Sources (ODBC).
2. Select System DSN Tab in Data Sources (ODBC) interface.
3. Click on [Add]. Select the Microsoft Text Driver. Click Finish.
4. Write a Data Source Name
5. Uncheck Use Current Directory to enable the [Select Directory ] button.
6. Click on [Select directory ] to determine the source directory.
7. Select the source file.
8. Click [OK] and return to the ODBC Text Setup screen.
9. Click [OK].
10. Return to the ODBC Data Source Administrator dialog and click [OK].
II. Importing from Flat file
1. Run MDM Import Manager.
2. Select ODBC from the Type drop-down field of the Connect To Source dialog.
3. Enter the DSN name from the Setup ODBC Connection dialog above.
4. Select the file name with extension (.csv or .txt) in the Tables panel of MDM Import Manager and the file content in the Records panel.
Hope this solved your problem.Please mark helpful answers
Regards,
Santosh. -
Identifying text file names and importing on single Excel sheet
Hey!
Does anybody can help me with Excel VBA macro code in order to import data from text files into single Excel spread sheet? I want to create User Form where user can select start and end date of interest and macro code will import
bunch of text files depending on user demands...
My text files are named: 20130619004948DataLog.txt (meaning: yyyy mm dd hh mm ss). Text file contains recordings for each 15 seconds... It would be great to omit time tail (meaning that user can only specify date). Text files for one day of interest (I have
text files covering whole year):
20130619004948DataLog.txt
20130619014948DataLog.txt
20130619024948DataLog.txt
20130619034948DataLog.txt
20130619044948DataLog.txt
20130619054948DataLog.txt
20130619064948DataLog.txt
20130619074948DataLog.txt
20130619084948DataLog.txt
20130619094948DataLog.txt
20130619104948DataLog.txt
20130619114948DataLog.txt
20130619124948DataLog.txt
20130619134948DataLog.txt
20130619144948DataLog.txt
20130619154948DataLog.txt
20130619164948DataLog.txt
20130619174948DataLog.txt
20130619184948DataLog.txt
20130619194948DataLog.txt
20130619204948DataLog.txt
20130619214948DataLog.txt
20130619224948DataLog.txt
20130619234948DataLog.txt
Option Explicit
Sub SearchFiles()
Dim file As Variant
Dim x As Integer
Dim myWB As Workbook
Dim WB As Workbook
Dim newWS As Worksheet
Dim L As Long, t As Long, i As Long
Dim StartDateL As String
Dim EndDateL As String
Dim bool As Boolean
bool = False ' to check if other versions are present
StartDateL = Format(Calendar1, "yyyymmdd")
EndDateL = Format(Calendar2, "yyyymmdd")
' I am using Userform asking user to select the date and time range of interet,
' However, I want to use only the date to filter the files having the name with that particular date
file = Dir("c:\myfolder\") ' folder with all text files
' I need assistance with the following part:
'1) How to filter and select the files between StartDateL and EndDateL_
'(including files with that dates as well)?
While (file <> "")
If InStr(file, StartDateL) > 0 Then 'Not sure if the statements inside parenthesis is correct
bool = True
GoTo Line1:
End If
file = Dir
Wend
Line1:
If Not bool Then
file = "c:\myfolder\20130115033100DataLog.txt" 'Just for a test that the code works as intended
End If
'This part for the selected text files to be loaded on a single Excel Sheet.
Set myWB = ThisWorkbook
Set newWS = Sheets(1)
L = myWB.Sheets(1).Cells(Rows.Count, "A").End(xlUp).Row
t = 1
For x = 1 To UBound(file)
Workbooks.OpenText Filename:=file(x), DataType:=xlDelimited, Tab:=True, Semicolon:=True, Space:=False, Comma:=False
Set WB = ActiveWorkbook
WB.Sheets(1).UsedRange.Copy newWS.Cells(t, 2)
t = myWB.Sheets(1).Cells(Rows.Count, "B").End(xlUp).Row + 1
WB.Close False
Next
myWB.Sheets(1).Columns(1).Delete
Application.ScreenUpdating = False
Rows("1:1").Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
End Sub- Make a new Excel file
- Open the VBA editor
- Add a Userform
- Place 2 text boxes and 1 command button on that form
- Paste all code below into the code module of the form
- Download this file:
https://dl.dropboxusercontent.com/u/35239054/FileSearch.cls
- In the VBA editor press CTRL-M and import that file
- Save the Excel file in the directory that contain your text files
- Run the form
You can format the columns of the sheet as you like, e.g. column E:H should be a number with 5 decimal places. The top row can contain some headings. My code did not affect the formatting or the headings.
Andreas.
Option Explicit
Private Sub UserForm_Initialize()
'Just a sample
Me.TextBox1.Value = FormatDateTime(Now, vbGeneralDate)
Me.TextBox2.Value = FormatDateTime(Now, vbShortDate)
End Sub
Private Sub CommandButton1_Click()
Dim StartDate As Date, EndDate As Date
Dim FS As New FileSearch
Dim R As Range
Dim ThisFile As Variant
Dim ThisDate As Date
Dim Data As Variant
Dim Count As Long
'Be sure we have 2 dates
If Not IsDate(Me.TextBox1.Value) Then
Me.TextBox1.SetFocus
MsgBox "No start date"
Exit Sub
End If
If Not IsDate(Me.TextBox2.Value) Then
Me.TextBox2.SetFocus
MsgBox "No end date"
Exit Sub
End If
'Convert to real dates
StartDate = CDate(Me.TextBox1.Value)
EndDate = CDate(Me.TextBox2.Value)
'Time part given?
If Fix(EndDate) = EndDate Then
'No include all files for this day
EndDate = EndDate + TimeSerial(23, 59, 59)
End If
'Correct order?
If StartDate > EndDate Then
ThisDate = EndDate
EndDate = StartDate
StartDate = ThisDate
End If
With FS
'Same path as our file
.LookIn = ThisWorkbook.Path
.FileName = "*DataLog.txt"
'Search all files sort by file name
If .Execute(msoSortByFileName, msoSortOrderAscending) = 0 Then
MsgBox "No data files found in " & .LookIn
Exit Sub
End If
'Clear previous data
Set R = Range("A2").CurrentRegion
If R.Row < 2 Then Set R = R.Offset(1)
R.ClearContents
'Show the user that we are working
Application.Cursor = xlWait
DoEvents
For Each ThisFile In .FoundFiles
'Get the date from the file name
ThisDate = Filename2Date(ThisFile)
'Between our dates?
If (ThisDate >= StartDate) And (ThisDate <= EndDate) Then
'Import at the end of the data
Set R = Range("A" & Rows.Count).End(xlUp).Offset(1)
Data = ReadCSV(ThisFile)
R.Resize(UBound(Data) + 1, UBound(Data, 2) + 1) = Data
Count = Count + 1
End If
Next
End With
'Done
Application.Cursor = xlDefault
If Count = 0 Then
MsgBox "No files match your dates"
Else
MsgBox Count & " files imported"
'Hide the form
Me.Hide
End If
End Sub
Private Function Filename2Date(ByVal Fullname As String) As Date
'Convert e.g "C:\20130601142648DataLog.txt" to the date "01.06.2013 14:26:48"
Dim i As Long, j As Long
i = InStrRev(Fullname, "\")
If i > 0 Then Fullname = Mid(Fullname, i + 1)
Fullname = JustNumbers(Fullname)
If Len(Fullname) <> 14 Then Exit Function
Filename2Date = _
DateSerial(Mid(Fullname, 1, 4), Mid(Fullname, 5, 2), Mid(Fullname, 7, 2)) + _
TimeSerial(Mid(Fullname, 9, 2), Mid(Fullname, 11, 2), Mid(Fullname, 13, 2))
End Function
Private Function JustNumbers(ByVal What As String) As String
'Return only numbers from What (by Rick Rothstein)
Dim i As Long, j As Long, Digit As String
For i = 1 To Len(What)
Digit = Mid$(What, i, 1)
If Digit Like "#" Then
j = j + 1
Mid$(What, j, 1) = Digit
End If
Next
JustNumbers = Left$(What, j)
End Function
Private Function ReadCSV(ByVal Fullname As String) As Variant
'Read a CSV file into an array
Const LDelim = vbCrLf 'Line delimiter
Const FDelim = ";" 'Field delimiter
Dim hFile As Integer
Dim Buffer As String
Dim Lines, Line, Data
Dim i As Long, j As Long
'Be sure the file exists
If Dir(Fullname) = "" Then Exit Function
'Open and read all data
hFile = FreeFile
Open Fullname For Binary Access Read As #hFile
Buffer = Space(LOF(hFile))
Get #hFile, , Buffer
Close #hFile
'Split into lines
Lines = Split(Buffer, LDelim)
'Split the first line and prepare the output
'Note: I assume that all lines have the same number of fields
Line = Split(Lines(0), FDelim)
ReDim Data(0 To UBound(Lines), 0 To UBound(Line))
For i = 0 To UBound(Lines)
Line = Split(Lines(i), FDelim)
For j = 0 To UBound(Line)
'Parse the fields
If IsDate(Line(j)) Then
Data(i, j) = CDate(Line(j))
ElseIf IsNumeric(Line(j)) Then
Data(i, j) = CDbl(Line(j))
Else
Data(i, j) = Line(j)
End If
Next
Next
ReadCSV = Data
End Function -
Trying to Scan in a List of Names Using a Delimiter from a Text File
Hello everyone,
I tried posting this question onto [Codecall Forums|http://forum.codecall.net/java-help/16064-trying-scan-list-names-using-delimiter-text-file.html] for an answer, but nobody really helped to solve this problem, so I'm reposting it here.
I'm trying to solve this problem on the Euler Project for practice. For the first part of the problem, I am supposed to scan in names in the following format: "name1","name2","name3". To solve this, I wrote the following code:
import java.io.*;
import java.util.*;
public class AlphabeticalSort
public static void main(String args[]) throws IOException
//import the file
Scanner input = new Scanner(new File("names.txt"));
input.useDelimiter("[\",]");
System.out.println(input.delimiter());
//scan it for the length of the array
int n = 0;
while (input.hasNext())
input.next();
n++;
System.out.println(n);
//import the names into the array
Scanner input2 = new Scanner(new File("names.txt"));
input2.useDelimiter("[\",]");
String[] names = new String[n];
for (int i=0; i<n; i++)
names[i] = input2.next();
System.out.println(names);
}However, when I tested this with a file containing "BOB","STEVE","MARK", n equaled 7 and my output was the names each separated by two empty lines. There are other methods I can use to solve this problem, but I would really like to know why my delimiters are not working so I can use them in the future.
Thanks,
helixed
Edited by: helixed on May 14, 2009 10:52 PMTake a look at [Quantifiers in Java regex|http://java.sun.com/docs/books/tutorial/essential/regex/quant.html].
I believe "[\",]+"{code} will get you the results you need.
Edited by: nogoodatcoding on May 15, 2009 11:54 AM -
Is it possible using PowerShell to compare the contents of two text files line by line and if a line is found output that line to a third text file?
Lets say hypothetically someone asks us to search a text file named names1.txt and when a name is found in names1.txt we then pair that with the same name in the second text file called names2.txt
lets say the names shown below are in names1.txt
Bob
Mike
George
Lets say the names and contents shown below are in names2.txt
Lisa
Jordan
Mike 1112222
Bob 8675309
Don
Joe
Lets say we want names3.txt to contain the data shown below
Mike 1112222
Bob 8675309
In vbscript I used search and replace commands to get part of the way there like this
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("testing.txt", ForReading)
strText = objFile.ReadAll
objFile.Close
strNewText = Replace(strText, "Mike ", "Mike 1112222")
Set objFile = objFSO.OpenTextFile("testing.txt", ForWriting)
objFile.WriteLine strNewText
objFile.Close
That script works great when you know the name you are looking for and the correct values. Lets say someone gives you a list of 1000 employees and says import these names into a list in the correct format and one sheet has the correct names only and
the other sheet has lots of extra names say 200000 and you only need the 1000 you are looking for in the format from names2.txt.Sure,
Here's a simple one:
$names1 = "C:\names1.txt"
$names2 = "C:\names2.txt"
$names3 = "C:\names3.txt"
Get-Content $names1 | ForEach-Object {
$names1_Line = $_
Get-Content $names2 | Where-Object {$_.Contains($names1_Line)} | Out-File -FilePath $names3 -Append
This basically just reads $names1 file, line by line, and then read $names2 file line by line as well.
If the line being evaluated from $names2 file contains the line being evaluated from $names1 file, then the line from $names2 file gets output to $names3 file, appending to what's already there.
This might need a few more tinkering to get it to perform faster etc depending on your requirements. For example:
- If either $names1 or $names2 contain a lot of entries (in the region of hundreds) then it will be faster to load the whole content of $names2 into memory rather than opening the file, reading line by line, closing and then doing the same for every single
line in $names1 (which is how it is currently works)
- Make sure that your comparison is behaving as expected. The .Contains method always does a case sensitive comparison, this might not be what you are after.
- You might want to put a condition to ignore blank lines or lines with spaces, else they'll also be brought over to $names3
Hopefully this will get you started though and ask if you have further questions.
Fausto -
File name to be generated from outbound text file data
Hi Experts,
I am collecting IDOCs and generating IDOC-XML(for IDOCS) file and sending it to PI 7.0 using sender file adapter.
This is File to File scenario.
IDOC-XML file picked by sender file adapter gets transformed using XSL mapping in to .dat(text) file.
Sample Output of .dat file (target file)
STR SE 2008-10-3011:13:00$SEQ
EIH21148862 D2008102820081127SEK000000894800000000894800000000000000 0000XYZ co Ltd KL25533781 2114886209 335592 2508867
EIL21148862 0000000000000000100000000000020081021 335592 20081010KILLL899 Operating System
Now I want output file name to be: ABC_DEF_cc_yyyymmdd_segno.dat
ABC_DEF is constant
cc - means country code, in this case it should be "SE", which is marked in bold immediately after STR.
yyyymmdd - date format
segno - which means no of records like number of lines in text file, (say three records: STR, EIH, EIL)
Please feel free for any clarifications required.
I hope I am able to explain scenario.
I would really appreciate if you can help me with your valuable inouts.
Thanks,
Divyeshhi,
just put one more mapping as the last mapping in your interface mapping
it can be abap or java mapping
then as per this blog fill out Filename attribute which will set the file name
/people/william.li/blog/2006/04/18/dynamic-configuration-of-some-communication-channel-parameters-using-message-mapping
you can parse the whole IDOC structure in tthose mappings to get all the data you need for the filename
this is the easiest way I'd say
Regards,
Michal Krawczyk
Maybe you are looking for
-
LMS 3.0 topology services and email notifications issue
Hi I have an LMS 3.0 install that was working when I installed it at a customer site a few months back. I went back in to give them an overview of its operation and there are now several issues. Nothing has changed since I installed it because the
-
How can I copy I tunes from my mac book 13 to my new mini I pad?
I have just purchased a mini I pad and want to share the information ie I tunes, which is currently on my mac book. How can this be done?
-
Problem using mplayer [solved]
Hi - I'm trying to run mplayer through its gui gmplayer. It doesn't run either from my normal user account or from root. From my user account I get this - process:2900): Gtk-WARNING **: This process is currently running setuid or setgid. This is not
-
Hi, I am an engineer of bangladesh television. We are using HP xw8400 with CS3 production premium and matrox axio le. because of Operating system problem, I have recovered OS (XP-sp2) from Recovery drive. I am trying to install a fresh copy of CS3 pr
-
Switch from Pc to Mac without upgrading.
I own Photoshop CS5 for windows and Adobe Premiere PRO CS4 but unfortunately my windows PC let me down and I just bought a iMAC. I was wondering if I can use my Adobe programs for windows into my new Mac and how I should proceed from now on. Thak you