structured file update


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting structured file update
# 1  
Old 06-24-2009
structured file update

Hi
I have a very structured file consisting of multiple lines as follows:

3752 AVAILABLE 06/24/2009 FFFF 000000 0000 0000
3753 TRADITION (ASIA) LTD TACB 008329 0000 0000
3754 WACHOVIA CONVS/PRFDS WBCP 001099 0000 0000
3755 AVAILABLE 05/12/2009 FFFF 000000 0000 0000
3756 TAIPEI FUBON BANK TFCB 062640 0000 0000
3757 DAISHIN SECURITIES DSSK 034951 0000 0000
3758 Dexia Capital Mkts DEXT 005253 0000 0000

Is there a way to substitute line:

"3756 TAIPEI FUBON BANK TFCB 062640 0000 0000"

with the following:

"3756 AVAILABLE 06/24/2009 FFFF 000000 0000 0000"

without opening the file.... Thanks a lot -A
# 2  
Old 06-24-2009
In a word... no! (unless someone else has a better idea)

And if you don't mind me saying, that's a rather odd question.

It's like having a dentist giving you a filling, without you opening your mouth Smilie
# 3  
Old 06-24-2009
Well, if the target and replacement lines are of identical length, one could theoretically open up the raw device, find the sector which contains this data, and rewrite that sector with the new data.

But if you make one little mistake... oops! there goes the filesystem!
# 4  
Old 06-24-2009
One could quite equally go to a Sudanese dentist?
Login or Register to Ask a Question

Previous Thread | Next Thread

6 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

awk to update file with partial matching line in another file and append text

In the awk below I am trying to cp and paste each matching line in f2 to $3 in f1 if $2 of f1 is in the line in f2 somewhere. There will always be a match (usually more then 1) and my actual data is much larger (several hundreds of lines) in both f1 and f2. When the line in f2 is pasted to $3 in... (4 Replies)
Discussion started by: cmccabe
4 Replies

2. UNIX for Dummies Questions & Answers

Converting unstructured data to structured data

Hi, Can someone help in converting the below unstructured data to a CSV format please. { "branchId" : "BNSFGDJNSJG-73264HB-132131BNHJFSDG", "branchName" : "NEWYORK-SSDF", "branchProductId" : "72Y5HFHSF7H3RUNAWEF", "PreferenceId" : "BASDBVcbzcYHcb", "emailId" :... (9 Replies)
Discussion started by: naveen.kuppili
9 Replies

3. Programming

Reading structured arguments

I am passing an argument to a C++ program which is going to look like I need to get the integers into arrays a, b, c, d with a= 12,12,34,2,12 b= 34,4,2,1,23 c= 5,5,4,4,13 d= 6,6,6,6,5 (5 Replies)
Discussion started by: kristinu
5 Replies

4. Shell Programming and Scripting

Using awk to create a summary of a structured file

I am trying to use awk to create a summary of a structured file. Here is what it looks like: (random text) H1 H2 H3 H4 44 78 99 30 31 -- 32 21 12 33 55 21 I'd like to be able to specify a column, say H2, and then have information about that column printed. ... (4 Replies)
Discussion started by: afulldevnull
4 Replies

5. Shell Programming and Scripting

Parsing structured files in Perl

Hi, looking for a piece of code to get the values from a structured text file like this: ############################################################################### ############################################################################### # # PERSONAL DATA DEFINITIONS #... (8 Replies)
Discussion started by: sarabande
8 Replies

6. UNIX for Dummies Questions & Answers

Entering directories structured above user.

I wish to enter directories which are on the HD but not part of the user hierarchy and have access to the contents of an external HD. To an advanced user this is probably a stupid question but I experimented with ~, cd, . and.. to no avail. I did check for a suitable command but couldn't find one.... (9 Replies)
Discussion started by: Frank Hunter
9 Replies
Login or Register to Ask a Question