Breaking output for specific pattern


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Breaking output for specific pattern
# 1  
Old 03-08-2006
Breaking output for specific pattern

Respected Sirs,

I have a text file which is unfortunately unformatted. I have something like

191728/02/06226278
191828/02/06226279
191928/02/06226280
192028/02/06226281
192128/02/06226282

Can some one suggest me the way so that I can store
1917
28/02/06
226278

in different variables.

I am using SCO Open Serve 5.

Thanks in advance for help / suggestion.

Best Regards
# 2  
Old 03-08-2006
Hi,

Try using cut command, with -c option
look into man pages for it,


Gaurav
# 3  
Old 03-08-2006
Thanks

Quote:
Originally Posted by gauravgoel
Hi,

Try using cut command, with -c option
look into man pages for it,


Gaurav
Thanks Gaurav for your adv.

Will post back if fails to use the command.

Best Regards,
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Extract whole word preceding a specific character pattern with first occurence of the pattern

Hello. Here is a file contents : declare -Ax NEW_FORCE_IGNORE_ARRAY=(="§" ="§" ="§" ="§" ="§" .................. ="§"Here is a pattern =I want to extract 'NEW_FORCE_IGNORE_ARRAY' which is the whole word before the first occurrence of pattern '=' Is there a better solution than mine :... (3 Replies)
Discussion started by: jcdole
3 Replies

2. Shell Programming and Scripting

Extract specific line in an html file starting and ending with specific pattern to a text file

Hi This is my first post and I'm just a beginner. So please be nice to me. I have a couple of html files where a pattern beginning with "http://www.site.com" and ending with "/resource.dat" is present on every 241st line. How do I extract this to a new text file? I have tried sed -n 241,241p... (13 Replies)
Discussion started by: dejavo
13 Replies

3. Shell Programming and Scripting

Want to get lines before specific pattern

Hi , I want to insert data into a new file after grepping specific pattern . for more info please read following for example: abc=12345678902222 def=45678904444 ------- ------- INAVLID ABC I want to "INAVLID ABC" grep above pattern from multiple files and want to write abc value and ... (3 Replies)
Discussion started by: vipin auja
3 Replies

4. Shell Programming and Scripting

Breaking the sum of a column when specific pattern is found

Hi Am trying to sum up a file # cat /Out maths 2 0.0 english 2091 0.2 history -1 0.0 physics 18 0.0 -------------------------------------- maths ... (9 Replies)
Discussion started by: Priya Amaresh
9 Replies

5. Shell Programming and Scripting

Displaying log file pattern output in tabular form output

Hi All, I have result log file which looks like this (below): from the content need to consolidate the result and put it in tabular form 1). Intercomponents Checking Passed: All Server are passed. ====================================================================== 2). OS version Checking... (9 Replies)
Discussion started by: Optimus81
9 Replies

6. Shell Programming and Scripting

Output breaking when returning multiple values

I've been trying to write a command-line function to grab a website's MX records and their ip addresses. The code below works with domains that only have one MX record: function kmx { mx=`host -t MX $1 | awk '{ print $7 }'`; ip=`host $mx | sed '/IPv6/d;/handled/d' | awk '{ print $4 }'`; ... (8 Replies)
Discussion started by: Azrael
8 Replies

7. UNIX for Dummies Questions & Answers

How to Detect Specific Pattern and Print the Specific String after It?

I'm still beginner and maybe someone can help me. I have this input: the great warrior a, b, c and what i want to know is, with awk, how can i detect the string with 'warrior' string on it and print the a, b, and c seperately, become like this : Warrior Type a b c Im still very... (3 Replies)
Discussion started by: radynaraya
3 Replies

8. UNIX for Dummies Questions & Answers

Search for very specific pattern with less

Hi, I want to search a certain pattern with less command in a files. For examples, I have a files with this entry: POLAR xx POLARX xc POLARXI x1 POLARZZZY vb POLARLLLLLLL ee... (1 Reply)
Discussion started by: anjas
1 Replies

9. Shell Programming and Scripting

how to grep a specific pattern

Hi I have a file in the following format: ftrn facc ttrd feed xref #1 1365 1366 1367 1097 1098 #2 1368 1369 1370 1095 1096 #3 1371 1372 1373 1065 1066 #4 1374 1375 1376 1099 1100 #5 1377 1378 1379 1080 1081 #6 ... (6 Replies)
Discussion started by: aoussenko
6 Replies

10. Shell Programming and Scripting

identify specific pattern

hello I want to create a folder under all partitions that are : /hostname1 /hostname2..... how to exclude /hostname (i.e start directly with /hostname1) thank you (1 Reply)
Discussion started by: melanie_pfefer
1 Replies
Login or Register to Ask a Question