Text file manipulation before load to ODS
Hello Experts,
I have a text file with 3 fields(comma separated): GLCode (Number), Desc1 (Char),
Desc2(Char) and need to load it into BW.
My Text file looks like:
1011.00,"Mejor PC Infrastructure","This line is ok."
1012.00,"Telephone Equipment $","This line ends in next line. Need to add next line,
1)Need to change the equipment immediately.
2)Take immediate action"
1013.00,"V1 Major Computer Server Infrastructure # Equip","For purchases
of components that make up the company's network, such as servers, hubs, routers etc."
1014.00,"Flash Drive","Need to provide all IT Developer"
This is how file looks like. Now I need the followings:
1. Need to remove the space and need to adjust the splitted line into one. Say here
line/record 2 is splitted into 3 lines and need to adjust in 1 line.
2. In Line 5 (Record 3) data splitted into 2 lines and need to make 1 line.
3. Need to remove bad characters.
4. Load into ODS after cleanup.
Need guidance, example.
Thank you.
Regards,
Bhakta
Could someone help me please how to proceed ?
Hi,
Go to Details tab in monitoring.
Just check for any packages are in yellow.
If any package i yellow then right click and take the Update manually option for that package only.
Or else you have to delete the request from the target and make the request in to red in monitor under Status tab.
Now you can try to load the data.
This is because of IDocs not processed successfully.
Regards,
Venkat
Similar Messages
-
How to skip the first row in Text file (in Sql Loader)
Hi All,
How to say the control file to skip the first row of the text file..
i just going this example
this is my text file:
01308201222455038130820122245503813082012224550382
1090358 474661834012245503813082012 0075 0 00000000000 000000000 00000130820120000000000000000 136.84 -833.3911082012 000000 000 009035847466183 090358 47466183 0015007514300000970001430000097700BH1150274792012081320120811201208122012-08-11-22.45.50.38369899999.0075LIQJGL17
Control file:
OPTIONS
DIRECT = TRUE ,
PARALLEL = FALSE ,
SKIP = 1,
ERRORS = 0
UNRECOVERABLE
LOAD DATA
INFILE <"FILE_DIR">
BADFILE <"FILE_DIR">
INSERT
INTO TABLE DAILY_TRANSACTION
WHEN (1:1)='D'
TRAILING NULLCOLS
Above the Eaxmple text file i need to Skip the first row which is
01308201222455038130820122245503813082012224550382
please can anyone suggest me is this correct?
if not please correct me please
since two days i been serching but i didn't get any thing
Thank's
Edited by: Lavanya on 24-Sep-2012 00:51Lavanya wrote:
Hi Jeneesh,
Thank you for your prompt replay
I didn't try to load this control file
And i need one more question
I have Text file in my Machine which Contains very huge data so i was wrote one control file for that, and i got FTP connection also as well as.
My question is firstly I need to PUT the Text file Into Unix Server isn't?
so when i trying to put the text file into unix it's giving an error
ftp>put c:/abc.txt
Not connectedYou haven't succesfully made your FTP connection to the server.
e.g.
c:\>ftp
ftp> o testserver
Connected to testserver.mycompany.com.
220 testserver FTP server ready.
User (testserver.mycompany.com:(none)): myuser
331 Password required for myuser.
Password:
230 User myuser logged in.
ftp>then you can use FTP to put your data to the server. Remember, if you are transferring a text file from a windows based operating system to a unix server you need to put it in ASCII mode...
ftp> ascii
200 Type set to A.
ftp>which will automatically convert the windows CR/LF pairs to the single LF character used by unix. -
Shell scripts to read data from a text file and to load it into a table
Hi All,
I have a text file consisting of rows and columns as follows,
GEF001 000093625 MKL002510 000001 000000 000000 000000 000000 000000 000001
GEF001 000093625 MKL003604 000001 000000 000000 000000 000000 000000 000001
GEF001 000093625 MKL005675 000001 000000 000000 000000 000000 000000 000001 My requirement is that, i should read the first 3 columns of this file using a shell script and then i have to insert the data into a table consisting of 3 rows in oracle .
the whole application is deployed in unix and that text file comes from mainframe. am working in the unix side of the application and i cant access the data directly from the mainframe. so am required to write a script which reads the data from text file which is placed in certain location and i have to load it to oracle database.
so I can't use SQL * loader.
Please help me something with this...
Thanks in advance.1. Create a dictionary object in Oracle and assign it to the folder where your file resides
2. Write a little procedure which opens the file in the newly created directory object using ULT_FILE and inside the FOR LOOP and do INSERTs to table you want
3. Create a shell script and call that procedure
You can use the post in my Blog for such issues
[Using Oracle UTL_FILE, UTL_SMTP packages and Linux Shell Scripting and Cron utility together|http://kamranagayev.wordpress.com/2009/02/23/using-oracle-utl_file-utl_smtp-packages-and-linux-shell-scripting-and-cron-utility-together-2/]
Kamran Agayev A. (10g OCP)
http://kamranagayev.wordpress.com -
Load multiple records in 1 table from 1 line in text file w/sql loader
hi guys,
quick question, perhaps someone can help. searched around and didn't see this question asked before, and can't find any answer in SQL Loader faqs or docs.
i know i can extract multiple logical records from a single physical record in the input file as two logical records, and then use two into tables clauses to load the data into the table. see oracle 9i sql loader control file reference chapter 5 to see what i am talking about.
but my question follows:
cust_id amount1_val amount1_qual amount2_val amount2_qual amount3_val amount3_qual
123 1500.35 TA 230.34 VZ 3045.50 TW
basically i want to use one sql loader statement to load these 3 records into 1 table. the issue for me is that i need to re-use the cust_id for all 3 records as the key, along with the qualifier code. the example in the Oracle docs only works for data where the logical records are completely separate -- no shared column values.
i'm sure this is possible, perhaps using some :cust_id type parameter for the 2nd and 3rd records, or something, but i just don't have enough knowledge/experience with sql loader to know what to do. appreciate any help.
wayneHi wayne,
I found an example on what exactly you were looking for from an SQL*Loader documentation. Please see if it of some help to you
EXAMPLE
The control file is ULCASE5.CTL.
1234 BAKER 10 9999 101
1234 JOKER 10 9999 777
2664 YOUNG 20 2893 425
5321 OTOOLE 10 9999 321
2134 FARMER 20 4555 236
2414 LITTLE 20 5634 236
6542 LEE 10 4532 102
2849 EDDS xx 4555
4532 PERKINS 10 9999 40
1244 HUNT 11 3452 665
123 DOOLITTLE 12 9940
1453 MACDONALD 25 5532
In the above datafile
Column1 - Empno
Column2 - ENAME
Column3 - Depno.
Column4 - MGR
Column5 - Proj no.
-- Loads EMP records from first 23 characters
-- Creates and loads PROJ records for each PROJNO listed
-- for each employee
LOAD DATA
INFILE 'ulcase5.dat'
BADFILE 'ulcase5.bad'
DISCARDFILE 'ulcase5.dsc'
1) REPLACE
2) INTO TABLE emp
(empno POSITION(1:4) INTEGER EXTERNAL,
ename POSITION(6:15) CHAR,
deptno POSITION(17:18) CHAR,
mgr POSITION(20:23) INTEGER EXTERNAL)
2) INTO TABLE proj
(empno POSITION(1:4) INTEGER EXTERNAL,
3) projno POSITION(25:27) INTEGER EXTERNAL) -- 1st proj
Notes:
REPLACE specifies that if there is data in the tables to be loaded (EMP and PROJ), SQL*loader should delete the data before loading new rows.
Multiple INTO clauses load two tables, EMP and PROJ. The same set of records is processed three times, using different combinations of columns each time to load table PROJ.
Regards,
Murali Mohan -
Loading from text file using Sql Loader
I need to load data from a text file into Oracle table. The file has long strings of text in the following format:
12342||||||Lots and lots of text with all kinds of characters including
^&*!#%#^@ etc.xxxxxxxxxxxxxxxxxxxxxxx
yyyyyyyyyyyyyyyyyyyyyyyyytrrrrrrrrrrrrrrrrrrr
uuuuuuuuuuuuuuuuuuurtgggggggggggggggg.||||||||
45356|||||||||||again lots and lots of text.uuuuuudccccccccccccccccccccd
gyhjjjjjjjjjjjjjjjjjjjjjjjjkkkkkkkkkkkkklllllllllllnmmmmmmmmmmmmnaaa|||||||.
There are pipes within the text as well. On the above example, the line starting with 12342 is an entire record that needs to be loaded into a CLOB column. The next record would be the 45356 one. Therefore, all records have a bunch of pipes at the end, so the only way to know where a new record starts is to see where the next number is after all the ending pipes. The only other thing I know is that there are a fixed number of pipes in each record.
Does anyone have any ideas on how I can load the data into the table either using sql loader or any other utility? Any input would be greatly appreciated. Thanks.STFF [url http://forums.oracle.com/forums/thread.jspa?messageID=1773678�]Sqlldr processing of records with embedded newline and delimiter
-
I would like to know if there is a way to populate a ring or enum control list using values maintained in a text file (or other format) outside of a VI. I have to be able to call this VI from TestStand or LabVIEW, and would like to be able to use the drop down interface to pick from the list of selections. As a result, the ring or enum list would need to be updated before the VI runs. I want to avoid just using a string to prevent typo's from creating errors. There would be several different VI's getting the list values from this text file. Is this possible, or am I way off base? Or does anyone have any other ideas or suggestions?
Thanks everyone,
q.Thanks for the replies. I had a chance to play with ring controls and updating the string array dynamically.
However, as I mentioned in my first post, one of the reasons I want to use dynamically updated lists is to have a readable drop down list in TestStand when you configure a step (i.e. Specify Module). This would help serve as a part of a hardware abstraction layer, and for maintainability purposes we don't want to split the hardware map among a number of VI's.
Unfortunately, TestStand doesn't seem to recognize the string list from a ring control. And as mentioned above, there are issues with updating Enums. Is it possible to accomplish a way of dynamically populating this list in such a way that TestStand will recognize it? Is there another control that would work better (e.g. list boxes, combo boxes, etc.)?
Thanks for your help,
q -
How to check the file size before loading it to the context
Hello,
I have an application to upload a file and write it to the server using the FileUpload UI and IWDResource Interface.
I would like to limit the size of the file the user is uploading to, say, 2MB.
The problem is that the current API doesn't allow me to check the file size before I store it in IWDResource. The API available for IWDResource:
IWDResource resource = ...
InputStream stream = resource.read(false);
size = stream.available();
Is working on the file only AFTER storing it in the context and the server's memory. This way, if a user decides to upload 1GB file for example, he can easily crash the server.
I am already familiar with <a href="https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/00062266-3aa9-2910-d485-f1088c3a4d71">this</a> arcticle but it doesn't answer this question as well, all it does is calculating the file size only after storing it in the context.
Any ideas...?
RoyHi Ram,
Have you activated your Objects ?
You need to activate your objects in order to see them in RWB.
Thanks & Regards,
Varun Joshi -
Concatenating the data file(Mbrs) before loading.. due to change in Outline
We have 8 Dimensions(11.1.1.3)
The data file is coming from the source system in this format from 3 yrs as below ..
D1 D2 D3 D4 D5 D6 Product, Curriency
. , . ,. , . , . , ., a , USD
. , . , ., . , . , . , a , EUR
. , . , . , . , . , ., b , GBP
. , . , . , . , . , . , b , INR
Now the product name as been changed in outline as
a_USD
a_EUR
b_GBP
b_INR
So, Is there any way in the hyperion suite(like in rules file or any other), where I can concatenate Product and currency and get the file as
D1 D2 D3 D4 D5 D6 , Product , Curriency
. . . . . . , a_USD , USD
. . . . . . , a_EUR , EUR
. . .. . . . , b_GBP , GBP
. . . . . . , b_INR , INR
Please do let me know
Thanks in Advance.
Edited by: 838300 on Sep 27, 2011 9:00 AMWhile what Mehmet wrote is correct, if this is anything more than a quick and dirty fix, may I suggest you go down another ETL path? (Yes, this is Cameron's load rule rant coming right at you, but in abbreviated form.)
ETL in a load rule is great to get the job done, but is a pain to maintain. You would be (unpleasantly) surprised how these have a way of growing. Have you given a thought to fixing it at the source or doing some true ETL in a tool like ODI, or staging it in SQL and doing the mods there? I know, for a simple(ish) change, that seems overkill, but load rules for the purposes of ETL are Evil.
Regards,
Cameron Lackpour
P.S. For anyone who must see me go bonkers over this, see: http://www.network54.com/Forum/58296/thread/1311019508/Data+Load+Optimization+-Headervs+Column -
How to clean file cache before loading PDF file ?
Hi,
I have one application in which we open PDF file inside it using the following api .
AxAcroPDFLib.AxAcroPDF axAcroPDF1 = new AxAcroPDFLib.AxAcroPDF();
axAcroPDF1.LoadFile(m_FileName);
What I observed that, when we open PDF files second time, it opens with a page where we have closed it for the first time.
It happens only when acrobat.exe is already running means if somebody already opened another PDF document and then we open and close the document in my application
So I wanted to know is there any way to clean file cache information so that it open file with the first page always ?.Moved to the Acrobat SDK forum: Acrobat SDK
-
Help with windows powershell - reading text file & manipulating the data
Hello,
I'm new to windows power shell & need your help/expertise in formatting the below *.txt file.
Could you please provide me with a sample powershell script which can accomplish the below request. Thank you so much for your help in advance.
<name>,<ticker>,<date>,<open>,<high>,<low>,<close>,<vol>,<oi>
GOOG 10-Jan-2014 1165 Put,GOOG140110P01165000,20140114,32.9,32.9,32.9,32.9,0,0
GOOG 10-Jan-2014 1170 Put,GOOG140110P01170000,20140114,40.87,40.87,40.87,40.87,0,0
GOOG 10-Jan-2014 1180 Put,GOOG140110P01180000,20140114,54.8,54.8,54.8,54.8,0,0
GOOG 10-Jan-2014 1190 Put,GOOG140110P01190000,20140114,50.9,50.9,50.9,50.9,0,0
GOOG 10-Jan-2014 1200 Put,GOOG140110P01200000,20140114,60.9,60.9,60.9,60.9,0,0
GOOG 10-Jan-2014 1300 Put,GOOG140110P01300000,20140114,157.8,157.8,157.8,157.8,0,0
PCLN 10-Jan-2014 1170 Call,PCLN140110C01170000,20140114,0.05,0.05,0.05,0.05,0,873
PCLN 10-Jan-2014 1172.5 Call,PCLN140110C01172500,20140114,0.01,0.01,0.01,0.01,0,136
PCLN 10-Jan-2014 1175 Call,PCLN140110C01175000,20140114,0.15,0.15,0.15,0.15,0,666
PCLN 10-Jan-2014 1177.5 Call,PCLN140110C01177500,20140114,0.05,0.05,0.05,0.05,0,174
PCLN 10-Jan-2014 1180 Call,PCLN140110C01180000,20140114,0.02,0.02,0.02,0.02,0,896
PCLN 10-Jan-2014 1182.5 Call,PCLN140110C01182500,20140114,0.07,0.07,0.07,0.07,0,138
PCLN 10-Jan-2014 1185 Call,PCLN140110C01185000,20140114,0.05,0.05,0.05,0.05,0,842
PCLN 10-Jan-2014 1187.5 Call,PCLN140110C01187500,20140114,0.05,0.05,0.05,0.05,0,36
PCLN 10-Jan-2014 1190 Call,PCLN140110C01190000,20140114,0.01,0.01,0.01,0.01,0,909
PCLN 10-Jan-2014 1192.5 Call,PCLN140110C01192500,20140114,0.2,0.2,0.2,0.2,0,88
PCLN 10-Jan-2014 1195 Call,PCLN140110C01195000,20140114,0.04,0.04,0.04,0.04,0,835
PCLN 10-Jan-2014 1197.5 Call,PCLN140110C01197500,20140114,0.25,0.25,0.25,0.25,0,22
PCLN 10-Jan-2014 1200 Call,PCLN140110C01200000,20140114,0.04,0.04,0.04,0.04,0,1073
PCLN 10-Jan-2014 1205 Call,PCLN140110C01205000,20140114,0.05,0.05,0.05,0.05,0,434
PCLN 10-Jan-2014 1210 Call,PCLN140110C01210000,20140114,0.03,0.03,0.03,0.03,0,346
PCLN 10-Jan-2014 1215 Call,PCLN140110C01215000,20140114,0.05,0.05,0.05,0.05,0,288
Z 22-Feb-2014 80 Call,Z140222C00080000,20140114,11.5,11.5,11.5,11.5,4,335
Z 22-Feb-2014 85 Call,Z140222C00085000,20140114,7.83,7.83,7.83,7.83,21,523
Z 22-Feb-2014 90 Call,Z140222C00090000,20140114,5.74,5.74,5.74,5.74,42,422
Z 22-Feb-2014 95 Call,Z140222C00095000,20140114,3.89,3.89,3.89,3.89,37,389
Z 22-Feb-2014 100 Call,Z140222C00100000,20140114,2.54,2.54,2.54,2.54,44,576
Z 22-Feb-2014 105 Call,Z140222C00105000,20140114,1.62,1.62,1.62,1.62,3,117
Z 22-Feb-2014 110 Call,Z140222C00110000,20140114,0.99,0.99,0.99,0.99,15,215
The ticker symbol in above file is max of 19 bytes. The software I use cannot convert this data, as it has a restriction of 14 bytes for ticker field.
I want to reduce the ticker field to 14 bytes using below logic & rewrite the modified symbol in the same column/file.
GOOG140110P01165000 - Ticker explanation is as shown below
Symbol : GOOG ( 4 bytes)
Year : 14 ( 2 bytes)
Month : 01 ( 2 bytes)
Date : 10 ( 2 bytes)
Call/Put : C or P ( 1 byte)
Strike : 01165 ( 5 bytes )
Strike (Decimal) : 000 ( 3 bytes)
Since they total to 19 bytes,my requirement is to bring down the ticker field size to 14 bytes using below formula.
1) Reduce year field to 1 byte i.e. 14 can be kept as 4
2) Strike ( Decimal) can be reduced to 1 byte ( drop the ending 2 bytes)
3) Month column ( 2 bytes) & call/put ( 1 byte) can be reduced to 1 byte ( saving of 2 bytes) by replacing 01 & C combination with A , 01 & P combination with B so on as mentioned below.
Month( 2 bytes)
Call/Put ( 1 byte)
Replace with
01
C
A
01
P
B
02
C
C
02
P
D
03
C
E
03
P
F
04
C
G
04
P
H
05
C
I
05
P
J
06
C
K
06
P
L
07
C
M
07
P
N
08
C
O
08
P
P
09
C
Q
09
P
R
10
C
S
10
P
T
11
C
U
11
P
V
12
C
W
12
P
X
So the modified ticker will look like GOOG4B10011650
GOOG - symbol
4 - year which is 2014 in this case
B- 01 ( jan) & Put (P) is replaced with letter B
10 - Date
01165 - Strike price
0 - Decimal portion of strike price
The output file should look like below.
<name>,<ticker>,<date>,<open>,<high>,<low>,<close>,<vol>,<oi>
GOOG 10-Jan-2014 1165 Put,GOOG410B011650,20140114,32.9,32.9,32.9,32.9,0,0
Thank you for your inputs with this request.
Regards,
AimforskyHi Neothwin,
Thank you for your prompt response. I really appreciate it. My file contains a header record.
I ran the conversion, it converts very fast.
I noticed the decimal portion of strike is lost in the conversion. AAL140110C00023500 must be converted as AAL4A1000235 but instead its showing as AAL4A10000230 ( last byte
should be 5 but it shows as 0)
Also I noticed it puts double quotes ('') in front of every column. I tried to drop ' in the code but it complains.
Also, instead of giving file name in the shell script , is it possible to go thru all files in a folder and convert them? I'm new to this scripting/programming sorry if I ask you the basic questions. Thank you so much for sparing your valuable time on this
request. Have a great day !
ORIGINAL FILE<name>,<ticker>,<date>,<open>,<high>,<low>,<close>,<vol>,<oi>
AAL 10-Jan-2014 23.5 Call,AAL140110C00023500,20140115,1.85,1.85,1.85,1.85,0,0
AAL 10-Jan-2014 24 Call,AAL140110C00024000,20140115,5.8,5.8,5.8,5.8,0,0
AAL 10-Jan-2014 24.5 Call,AAL140110C00024500,20140115,2.05,2.05,2.05,2.05,0,0
AAL 10-Jan-2014 25 Call,AAL140110C00025000,20140115,2.3,2.3,2.3,2.3,0,0
AAL 10-Jan-2014 25.5 Call,AAL140110C00025500,20140115,1.35,1.35,1.35,1.35,0,0
AAL 10-Jan-2014 26 Call,AAL140110C00026000,20140115,3.4,3.4,3.4,3.4,0,0
AAL 10-Jan-2014 26.5 Call,AAL140110C00026500,20140115,2.65,2.65,2.65,2.65,0,0
AAL 10-Jan-2014 27 Call,AAL140110C00027000,20140115,2.26,2.26,2.26,2.26,0,0
AAL 10-Jan-2014 27.5 Call,AAL140110C00027500,20140115,1.75,1.75,1.75,1.75,0,0
AAL 10-Jan-2014 28 Call,AAL140110C00028000,20140115,1.45,1.45,1.45,1.45,0,0
AAL 10-Jan-2014 28.5 Call,AAL140110C00028500,20140115,0.9,0.9,0.9,0.9,0,0
AAL 10-Jan-2014 29 Call,AAL140110C00029000,20140115,0.4,0.4,0.4,0.4,0,0
AAL 10-Jan-2014 29.5 Call,AAL140110C00029500,20140115,0.05,0.05,0.05,0.05,0,4812
AAL 10-Jan-2014 30 Call,AAL140110C00030000,20140115,0.05,0.05,0.05,0.05,0,636
AAL 10-Jan-2014 21.5 Put,AAL140110P00021500,20140115,0.08,0.08,0.08,0.08,0,11
AAL 10-Jan-2014 23 Put,AAL140110P00023000,20140115,0.05,0.05,0.05,0.05,0,51
AAL 10-Jan-2014 23.5 Put,AAL140110P00023500,20140115,0.05,0.05,0.05,0.05,0,235
AAL 10-Jan-2014 24 Put,AAL140110P00024000,20140115,0.1,0.1,0.1,0.1,0,77
AAL 10-Jan-2014 24.5 Put,AAL140110P00024500,20140115,0.05,0.05,0.05,0.05,0,292
AAL 10-Jan-2014 25 Put,AAL140110P00025000,20140115,0.05,0.05,0.05,0.05,0,1380
AAL 10-Jan-2014 25.5 Put,AAL140110P00025500,20140115,0.02,0.02,0.02,0.02,0,1549
AAL 10-Jan-2014 26 Put,AAL140110P00026000,20140115,0.1,0.1,0.1,0.1,0,665
AAL 10-Jan-2014 26.5 Put,AAL140110P00026500,20140115,0.02,0.02,0.02,0.02,0,632
AAL 10-Jan-2014 27 Put,AAL140110P00027000,20140115,0.05,0.05,0.05,0.05,0,2161
AAL 10-Jan-2014 27.5 Put,AAL140110P00027500,20140115,0.1,0.1,0.1,0.1,0,310
AAL 10-Jan-2014 28 Put,AAL140110P00028000,20140115,0.01,0.01,0.01,0.01,0,642
AAL 10-Jan-2014 28.5 Put,AAL140110P00028500,20140115,0.05,0.05,0.05,0.05,0,291
AAL 10-Jan-2014 29 Put,AAL140110P00029000,20140115,0.05,0.05,0.05,0.05,0,6728
AAL 10-Jan-2014 29.5 Put,AAL140110P00029500,20140115,0.3,0.3,0.3,0.3,0,0
AAL 10-Jan-2014 30 Put,AAL140110P00030000,20140115,4.3,4.3,4.3,4.3,0,0
AAL 10-Jan-2014 32 Put,AAL140110P00032000,20140115,2.6,2.6,2.6,2.6,0,0
AAL 18-Jan-2014 0.5 Call,AAL140118C00000500,20140115,11,11,11,11,0,180
AAL 18-Jan-2014 1 Call,AAL140118C00001000,20140115,27.9,27.9,27.9,27.9,0,68
AAL 18-Jan-2014 2 Call,AAL140118C00002000,20140115,22.7,22.7,22.7,22.7,0,7
AAL 18-Jan-2014 3 Call,AAL140118C00003000,20140115,17.15,17.15,17.15,17.15,0,10
CONVERTED FILE:"<name>","<ticker>","<date>","<open>","<high>","<low>","<close>","<vol>","<oi>"
"AAL 10-Jan-2014 23.5 Call","AAL4A10000230","20140115","1.85","1.85","1.85","1.85","0","0"
"AAL 10-Jan-2014 24 Call","AAL4A10000240","20140115","5.8","5.8","5.8","5.8","0","0"
"AAL 10-Jan-2014 24.5 Call","AAL4A10000240","20140115","2.05","2.05","2.05","2.05","0","0"
"AAL 10-Jan-2014 25 Call","AAL4A10000250","20140115","2.3","2.3","2.3","2.3","0","0"
"AAL 10-Jan-2014 25.5 Call","AAL4A10000250","20140115","1.35","1.35","1.35","1.35","0","0"
"AAL 10-Jan-2014 26 Call","AAL4A10000260","20140115","3.4","3.4","3.4","3.4","0","0"
"AAL 10-Jan-2014 26.5 Call","AAL4A10000260","20140115","2.65","2.65","2.65","2.65","0","0"
"AAL 10-Jan-2014 27 Call","AAL4A10000270","20140115","2.26","2.26","2.26","2.26","0","0"
"AAL 10-Jan-2014 27.5 Call","AAL4A10000270","20140115","1.75","1.75","1.75","1.75","0","0"
"AAL 10-Jan-2014 28 Call","AAL4A10000280","20140115","1.45","1.45","1.45","1.45","0","0"
"AAL 10-Jan-2014 28.5 Call","AAL4A10000280","20140115","0.9","0.9","0.9","0.9","0","0"
"AAL 10-Jan-2014 29 Call","AAL4A10000290","20140115","0.4","0.4","0.4","0.4","0","0"
"AAL 10-Jan-2014 29.5 Call","AAL4A10000290","20140115","0.05","0.05","0.05","0.05","0","4812"
"AAL 10-Jan-2014 30 Call","AAL4A10000300","20140115","0.05","0.05","0.05","0.05","0","636"
"AAL 10-Jan-2014 21.5 Put","AAL4B10000210","20140115","0.08","0.08","0.08","0.08","0","11"
"AAL 10-Jan-2014 23 Put","AAL4B10000230","20140115","0.05","0.05","0.05","0.05","0","51"
"AAL 10-Jan-2014 23.5 Put","AAL4B10000230","20140115","0.05","0.05","0.05","0.05","0","235"
"AAL 10-Jan-2014 24 Put","AAL4B10000240","20140115","0.1","0.1","0.1","0.1","0","77"
"AAL 10-Jan-2014 24.5 Put","AAL4B10000240","20140115","0.05","0.05","0.05","0.05","0","292"
"AAL 10-Jan-2014 25 Put","AAL4B10000250","20140115","0.05","0.05","0.05","0.05","0","1380"
"AAL 10-Jan-2014 25.5 Put","AAL4B10000250","20140115","0.02","0.02","0.02","0.02","0","1549"
"AAL 10-Jan-2014 26 Put","AAL4B10000260","20140115","0.1","0.1","0.1","0.1","0","665"
"AAL 10-Jan-2014 26.5 Put","AAL4B10000260","20140115","0.02","0.02","0.02","0.02","0","632"
"AAL 10-Jan-2014 27 Put","AAL4B10000270","20140115","0.05","0.05","0.05","0.05","0",”2161" -
How to load a text file (ASCII) into a TS string variable?
I need to load a ASCII file into a TS string variable for subsequent processing. I tried the SecuenceBuilder DLL (in the examples directory) but it seems that this DLL has a bug. Some text files are not loaded properly. I have also tried the kernel32 functions (openfile, createfile, readfile ... ) handling them as a C program, but with no success. The property loader feature of TS is not the suitable solution for me, because I would have to modify all my text files to include some specific fields (step name, variables, starmarker ...). Doy you know an alternative procedure to load text files or any DLL that implements what I look for ? Any help would be grateful. Cesar ([email protected])
Hi Cesar,
I don't know if you have found a solution, but attached is a DLL built in VC that will read the text out of a file into a TestStand variable. The attached sequence file \SequenceFile1.seq contains a step type that is set to call the DLL responsible for reading the file. It reads the file specified under Step.FilePath and stores the data in Step.ReadData. Please let me know if this works for you. I have attached the source as well.
Regards,
Bob
Attachments:
ReadFile.zip 3628 KB -
Movie refuses to load variables from text file
Hi,
I'm sure you can solve my newbie problem in less than 1
minute...
I'm pulling my hair out on a template I bought 2 days ago
from templatemonster.com
I am using Flash 8 Pro.
All I want to do is change an existing textfield that is
Static to Dynamic and load variables from a text file.
The Action Script I use to do so comes directly from
Macromedia documentation (see attached)
It works fine when I create a brand new movie, but doesn't do
anything when inserted into the template.
It doesn't even complain about not finding the text file if I
rename or delete it!
Here are the FLA and text file:
Edit : Link to source file removed
The textfield I would like to change is in the txt2 symbol.
Here is how I proceed:
When I open HEADER.FLA, Flash tells me I'm missing a font,
ok, so I click on Use Default, I'll deal with this later.
I open up the Movie Explorer, go to Layer 30, go to Frame 75
and click once on txt2
I name the instance "myMovie_mc" and save (converts from
Flash MX to Flash 8)
I double-click on the Movie Clip, select the word
"Automobile" on the Stage, change from Static to Dynamic and call
that instance "myText_txt"
Still in the Movie Clip, I create a new layer I call
"actions", and in Frame 1 I copy the attached Action Script:
This script works when I create a new flash file, but it does
absolutely nothing in this template.
I know I'm doing something wrong, but I wonder what?
Many thanks to any helping soul!
Ferris.try this:
// Load text as variable and assign it to the
// dynamic text field
var features_lv:LoadVars = new LoadVars();
features_lv.onLoad = onText();
features_lv.load("safetyFeatures.txt");
function onText(success:Boolean) {
if (success) {
myText_txt.text = features_lv.safetyfeatures;
} else {
myText_txt.text = "unable to load text file.";
or this
// Load text as variable and assign it to the
// dynamic text field
var features_lv:LoadVars = new LoadVars();
features_lv.onLoad = function(success) {
if (success) {
myText_txt.text = features_lv.safetyfeatures;
} else {
myText_txt.text = "unable to load text file.";
features_lv.load("safetyFeatures.txt"); -
Down load or create text file using bapi
hi friends,
My requirement is to create text file or down load text file in presentation server when the bapi runs in which the ip address is defined at the interface.
plz sujjest me,
points will be rewarded .
prasad.Hi,
The FM 'GUI_DOWNLOAD' should use the network path like '
10.10.10.10\shared_file\PO.txt'. Pass this value to the file path parameter and execute the program.
Thanks..
Preetham S -
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 -
How to define special character in html text file used in loadvars
Hi
I'm witing some maths software and need to use the division
sign in a text file which is loaded using LoadVars().
The variable loaded is then assigned to a text area. Here's
the variable example.
&hint1=<title><b>Challenge 1: Instant recall
of any table</b></title><p>Including table
divisions eg 56 ÷ 8= </p>
the division sign is missing or a just a box. I've already
tried most options: ÷ (which works in XML loaded to
flash), ÷ %F7
Can anyone help please?Hi Michael. Thank you for your reply.
There is no declaration within sgm file itself - but while opening the file I use sgml application definition with the following settings:
Default API client: FmTranslator
SGML character encoding: ISO Latin1
XML character encoding: UTF-8
Namespace: Enable
CSS2 Preferences:
Generate CSS2: Disable
Add Fm CSS Attribute To XML: Disable
Retain Stylesheet Information: Disable
Entity locations
Entity search paths
C:\Program Files\Adobe\FrameMaker9\Structure\sgml\isoents
So as you can see, character encoding is set to ISO Latin1 (there is no way to use UTF-8 encoding in sgml files)
Typing ź or ć in sgm document and opening it with framemaker sgml application - I receive: ¿æ and message: "Non-SGML character found; should have been character reference"
Everything works fine when I type f.ex.: &x016B; and insert appropriate reference lines into isolat1.rw and isolat1.ent files
But what I would like to avoid is editing those isoent files each time new character is be needed.
Maybe you are looking for
-
this is a new build my specs are motherboard k9n4 sli cpu amd anthlon 64 x2 4600 ram ocz 6400 dual channel 2x 2gig power supply ocz game extreme 700 video card evga 8800gts hard d
-
Where are my itunes videos i downloaded
where do i find my itunes videos that i downloaded from my computer onto my ipad on my ipod they are on the "iPod" app but the music app on the ipad doesnt have my videos
-
Dear Experts, Can I have two separate forms for Cash receipts and cash payments while running the FBCJ transaction. If so how can I manage the same. As in the configuration for the RFKORD80 program we assign a form and this is triggered when the corr
-
Profit center field in production order master data in KKF3
Hi GUrus, is there any way of mass updating the profit center field in production order master data in KKF3 transaction. PLease help Anusha
-
Illustrator CS6 (Mac) crashes when opening large documents with drop shadows
I have a Macbook Pro ver. 10.6.8 i7 Core, 8 Gb Ram, and I am running Adobe Illustrator CS6. I have a document that is 18" x 42" and contains drop shadows. It was created using CS6. When I apply a graphic style (gradient and drop shadow) It has a prog