hiCreateReport feild

Guest
Hi guys,

I want to create a list( which i want to pass it to the ?choices of hiCreateReportField form) while reading the list from a file line by line

Say the file contents are like this (I took only two lists; it can be more too)

("1" "OSC_ALL" "Misc" "M2" "No" "(11508.2" "414.511)" "Low" "asad-Aug/24/2012")
("2" "OSC_ALL" "Misc" "M1" "No" "(11461.12" "423.483)" "Low" "asad-Aug/24/2012")


I want to add all of them to a new list & pass it to hiCreateReportField like

?choices list(("1" "OSC_ALL" "Misc" "M2" "No" "(11508.2" "414.511)" "Low" "asad-Aug/24/2012")
("2" "OSC_ALL" "Misc" "M1" "No" "(11461.12" "423.483)" "Low" "asad-Aug/24/2012"))

I tried doing lineread or gets to access contents from the file one by one but it adds extra backslash character after reading.

like

"(\"1\" \"OSC_ALL\" \"Misc\" \"M2\" \"No\" \"(11508.2\" \"414.511)\" \"Low\" \"asad-Aug/24/2012\") \n"

Please tell me how can I do this.
 
Hello "mdubey,"

Lineread should work. You could try and experiment in the CIW:

CIW> port = infile("data.txt")
CIW> a = lineread(port)
CIW> b = lineread(port)
CIW> c = lineread(port)

The calls to lineread() above should either return t (which means a
comment or blank input line was read), nil (meaning that EOF was
reached) or a list of the expressions which were read.

The "extra backslashes" might be due to the way you echo the expressions
which were read; type(a), type(b) or type(c) above should return either
symbol, null or list—not string.

HTH, -D

P.-S. — Untested as I don't have a CIW at hand.

mdubey2507@gmail.com writes:
Hi guys,

I want to create a list( which i want to pass it to the ?choices of
hiCreateReportField form) while reading the list from a file line by
line

Say the file contents are like this (I took only two lists; it can be more too)

("1" "OSC_ALL" "Misc" "M2" "No" "(11508.2" "414.511)" "Low" "asad-Aug/24/2012")
("2" "OSC_ALL" "Misc" "M1" "No" "(11461.12" "423.483)" "Low" "asad-Aug/24/2012")


I want to add all of them to a new list & pass it to hiCreateReportField like

?choices list(("1" "OSC_ALL" "Misc" "M2" "No" "(11508.2" "414.511)"
"Low" "asad-Aug/24/2012")
("2" "OSC_ALL" "Misc" "M1" "No" "(11461.12" "423.483)" "Low"
"asad-Aug/24/2012"))

I tried doing lineread or gets to access contents from the file one by
one but it adds extra backslash character after reading.

like

"(\"1\" \"OSC_ALL\" \"Misc\" \"M2\" \"No\" \"(11508.2\" \"414.511)\"
\"Low\" \"asad-Aug/24/2012\") \n"

Please tell me how can I do this.
--
http://crosstwine.com
tel: +49 89 2189 2939
cell: +49 174 3489 428
 

Welcome to EDABoard.com

Sponsor

Back
Top