Sponsored Content
Top Forums Shell Programming and Scripting Help with Reading Text from file Post 302231445 by yajaykumar on Tuesday 2nd of September 2008 10:15:01 AM
Old 09-02-2008
Data Help with Reading Text from file

Hello,

I am having a tough time reading data from an input text file.
The input file has lines of data which is comma seperated. Each line represents a record/row, but unfortunately the data in the individual column/fields have spaces and `cat filename`is not returning entire line ( to read individual records).

How can I read individual records from this file? Is there a way to do it?
Below is a sample of the input file and it is also attached with this post.

Content Type,Author,Initial Submit Date,Task Name,Task Start Date,Task End Date,Task Owner,Completion Date
Workflow Properties,wcm_master,,,Workflow Properties,Workflow Properties,Workflow Properties,Workflow Properties
Workflow Properties,wcm_master,,,Workflow Properties,Workflow Properties,Workflow Properties,Workflow Properties
Workflow Properties,wcm_master,1217361943,TaskAddFile,Workflow Properties,Workflow Properties,Workflow Properties,Workflow Properties
Workflow Properties,wcm_master,1217362058,TaskAddFile,Workflow Properties,Workflow Properties,Workflow Properties,Workflow Properties
Email Test Flow,wcm_master,1217971876,TaskAddFile,Email Test Flow,Email Test Flow,Email Test Flow,Email Test Flow
CGI Test,n1plomen,1219776115,TaskAddFile,CGI Test,CGI Test,CGI Test,CGI Test
CGI Test,n1plomen,1219776268,TaskAddFile,CGI Test,CGI Test,CGI Test,CGI Test
CGI Test,n1plomen,1219776333,TaskAddFile,CGI Test,CGI Test,CGI Test,CGI Test
CGI Test,n1plomen,1219776417,TaskAddFile,CGI Test,CGI Test,CGI Test,CGI Test
CGI Test,n1plomen,1219776470,TaskAddFile,CGI Test,CGI Test,CGI Test,CGI Test
CGI Test,n1plomen,1219787503,TaskAddFile,CGI Test,CGI Test,CGI Test,CGI Test
CGI Test,n1plomen,1219787605,TaskAddFile,CGI Test,CGI Test,CGI Test,CGI Test
Email Test Flow,wcm_author,1219865848,TaskAddFile,Email Test Flow,Email Test Flow,Email Test Flow,Email Test Flow
Email Test Flow,wcm_author,1219865871,TaskAddFile,Email Test Flow,Email Test Flow,Email Test Flow,Email Test Flow
Email Test Flow,wcm_author,1219865908,TaskAddFile,Email Test Flow,Email Test Flow,Email Test Flow,Email Test Flow


Your help is highly appreciated!

Thank you,
Ajay
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

reading text file

I have a text file with 50 munbers. I wanna read these numbers and append "@yahoo.com" and send emails to them using shell scripting.......... How do i read the inetegres from the text file. (1 Reply)
Discussion started by: jaan
1 Replies

2. Shell Programming and Scripting

Reading text from a file

Guys, I am trying to read text from a file, into arrays. The format of the file is: @DATABASE femotest @PACKAGE_SPECS /usr/home/oracle92/sosa/scripts/test.pks /usr/home/oracle92/sosa/scripts/rep.pks @PACKAGE_BODIES ... (12 Replies)
Discussion started by: LiquidChild
12 Replies

3. Shell Programming and Scripting

Reading from Text file.....

Hi Im MZ.... please help me with my requirements..... Requirement: I have a text file named information.txt which contains information about Oracle Instances, I want to fetch data's from that text file and want to display an output using shell script. Explanation : i.e. when I execute that... (0 Replies)
Discussion started by: user__user3110
0 Replies

4. UNIX for Dummies Questions & Answers

Help with reading text file

How can i have a while loop as follows while read inputline do <task> done < name_list and also store the values (delimited) on each line to temp variables so as to print them on screen as follows while read inputline do set name | cut -d "," -f1 name_list # #i know this is not... (1 Reply)
Discussion started by: bilal05
1 Replies

5. Programming

reading a text file in c++

hello all , im trying to read a text file and display its contents. While i got the code running and the output was displayed perfectly for sometime , i started getting Abort(core dump) error . Am i missing something here ? im using HP-UX. #include <iostream.h> #include <fstream.h> #include... (1 Reply)
Discussion started by: vishy_85
1 Replies

6. Shell Programming and Scripting

Reading a value from another text file

I am having a text file best = 100 genre = 75 group = 53 . . and so on I need to read those values (100,75,53,...) from my shell script. I have to do the same function for all the variables. So in my script i used for loop to do the same. for { a=best b=100 } Video tutorial on... (3 Replies)
Discussion started by: kishorekumar87
3 Replies

7. Shell Programming and Scripting

Reading the text file for particular format

Hi All, Need your help!! I have particular host file with below format: 172.34.45.67 Host1 Host2 134.45.56.67 Host3 Host4 Host5 I need shell script snippet which read this file and change the format of the file to the below format 172.34.45.67 Host1 172.34.45.67 ... (9 Replies)
Discussion started by: sharsour
9 Replies

8. Shell Programming and Scripting

Reading colums from a text file

Hi all, I have a text file that has (4) columns. There are about 300 lines on this file. It is a plain text file. I am looking to write a simple script that will read each line from the file and generate another text file. The file looks something like this: These are the columns: ... (4 Replies)
Discussion started by: adamw
4 Replies

9. UNIX for Dummies Questions & Answers

Reading Xml file and print the values into the text file in columnwise?

hi guys, i want help... Reding XML file and print the values into the text file using linux shell script file as per below xml file <sequence> <Filename>aldorzum.doc</Filename> <DivisionCode>US</DivisionCode> <ContentType>Template</ContentType> <ProductCode>VIMZIM</ProductCode> </sequence>... (4 Replies)
Discussion started by: sravanreddy
4 Replies

10. Programming

How to write in other language in text/xml file by reading english text/xml file using C++?

Hello Team, I have 2 files.one contains english text and another contains Japanese. so i have to read english text and replace the text with Japanesh text in third file. Basically, I need a help to write japanese language in text/xml file.I heard wstring does this.Not sure how do i write... (2 Replies)
Discussion started by: SA_Palani
2 Replies
TEXT(1) 						User Contributed Perl Documentation						   TEXT(1)

NAME
XML::DOM::Text - A piece of XML text in XML::DOM DESCRIPTION
XML::DOM::Text extends XML::DOM::CharacterData, which extends XML::DOM::Node. The Text interface represents the textual content (termed character data in XML) of an Element or Attr. If there is no markup inside an element's content, the text is contained in a single object implementing the Text interface that is the only child of the element. If there is markup, it is parsed into a list of elements and Text nodes that form the list of children of the element. When a document is first made available via the DOM, there is only one Text node for each block of text. Users may create adjacent Text nodes that represent the contents of a given element without any intervening markup, but should be aware that there is no way to represent the separations between these nodes in XML or HTML, so they will not (in general) persist between DOM editing sessions. The normalize() method on Element merges any such adjacent Text objects into a single node for each block of text; this is recommended before employing operations that depend on a particular document structure, such as navigation with XPointers. METHODS splitText (offset) Breaks this Text node into two Text nodes at the specified offset, keeping both in the tree as siblings. This node then only contains all the content up to the offset point. And a new Text node, which is inserted as the next sibling of this node, contains all the con- tent at and after the offset point. Parameters: offset The offset at which to split, starting from 0. Return Value: The new Text node. DOMExceptions: o INDEX_SIZE_ERR Raised if the specified offset is negative or greater than the number of characters in data. o NO_MODIFICATION_ALLOWED_ERR Raised if this node is readonly. perl v5.8.0 2000-01-31 TEXT(1)
All times are GMT -4. The time now is 10:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy