Sponsored Content
Full Discussion: Split positional flat file.
Top Forums Shell Programming and Scripting Split positional flat file. Post 302340215 by meetmedude on Monday 3rd of August 2009 04:35:40 AM
Old 08-03-2009
Split positional flat file.

Hi,

I need to split positional flat file, based on value at position 43-45.( in red "410")
Example:
12345678907886421689200920184820410200920020092002007
12345678907886421689 200920184820411200920020092002007
12345678907886421689 200920184820411200920020092002007
12345678907886421684 200924184820410200920020092002007
12345678907886421684 200924184820411200920020092002007
12345678907886421684 200924184820411200920020092002007

I tried using read line but it reduces the space and so positions get changed.

Is there any other way of doing this.

Please advice.

Thanks.

---------- Post updated at 03:35 AM ---------- Previous update was at 03:31 AM ----------

Hi,

I need to split positional flat file, based on value at position 43-45.( in red "410")
Example:
12345678907886421689 200920184820410200920020092002007
12345678907886421689 200920184820411200920020092002007
12345678907886421689 200920184820411200920020092002007
12345678907886421684 200924184820410200920020092002007
12345678907886421684 200924184820411200920020092002007
12345678907886421684 200924184820411200920020092002007


I tried using read line but it reduces the space and so positions get changed.

Is there any other way of doing this.

Please advice.

Thanks.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with a Flat File!!!

Hi All, I need a help with a shelll script program.I get a '|' separated file which sometime has a encrypted column.And this encryption sometime breaks the last column data into a new line and this is not picked by the ETL.So when i run a script,it should append back the broken new line data... (11 Replies)
Discussion started by: kumarsaravana_s
11 Replies

2. Shell Programming and Scripting

Perl : split flat line's to $

Hi, below is the software list of lines I have, MozillaSrc 1.7.8.00.00 Mozilla 1.78 Source Distribution NFS B.11.11 ONC/NFS; Network-File System,Information Services,Utilities NParProvider B.11.11.01.04.01.01 nPartition Provider NPartition ... (7 Replies)
Discussion started by: acomd2
7 Replies

3. UNIX for Dummies Questions & Answers

Split a file with no pattern -- Split, Csplit, Awk

I have gone through all the threads in the forum and tested out different things. I am trying to split a 3GB file into multiple files. Some files are even larger than this. For example: split -l 3000000 filename.txt This is very slow and it splits the file with 3 million records in each... (10 Replies)
Discussion started by: madhunk
10 Replies

4. Shell Programming and Scripting

Flat file

Hi I have a flat file looking this QWER 2:35 7044 00001 ROUT 1188 EA SS ASD 2:36 7044 00010 ROUT BSD 2:37 7044 00011 ROUT END QWER 3:35 7044 00011 ROUT 1088 EA SS ASD 3:36 7044 00010 ROUT BSD 3:37 7044 00011 ROUT... (9 Replies)
Discussion started by: Krishnaramjis
9 Replies

5. Programming

compare XML/flat file with UNIX file system structure

Before i start doing something, I wanted to know whether the approach to compare XML file with UNIX file system structure. I have a pre-configured file(contains a list of paths to executables) and i need to check against the UNIX directory structure. what are the various approches should i use ? I... (6 Replies)
Discussion started by: shafi2all
6 Replies

6. Shell Programming and Scripting

Get the positional value from first line of the file

Hi, I have one flat file with delimited field as pipe(|) symbol. The file contains header,detail lines. Header is the first line in the file. I want to read the value for the position from 15 to 18 in first line of the file. Pls help me to get the value from position 15 to 18 in... (3 Replies)
Discussion started by: praka
3 Replies

7. Shell Programming and Scripting

Searching for Log / Bad file and Reading and writing to a flat file

Need to develop a unix shell script for the below requirement and I need your assistance: 1) search for file.log and file.bad file in a directory and read them 2) pull out "Load_Start_Time", "Data_File_Name", "Error_Type" from log file 4) concatinate each row from bad file as... (3 Replies)
Discussion started by: mlpathir
3 Replies

8. UNIX for Dummies Questions & Answers

Remove lines in a positional file based on string value

Gurus, I am relatively new to Unix scripting and am struck with a problem in my script. I have positional input file which has a FLAG indicator in at position 11 in every record of the file. If the Flag has value =Y, then the record from the input needs to be written to a new file.However if... (3 Replies)
Discussion started by: gsam
3 Replies

9. Shell Programming and Scripting

Positional Update of XML File

Hello, I have a XML file and need to update the data for a specific XML Attribute in the file. I need a Perl or Awk command to look for <INTERCHANGE_CONTROL_NO>000000601</INTERCHANGE_CONTROL_NO> in the XML file and change the first two 0 of the value to 9. For instance ... (4 Replies)
Discussion started by: Praveenkulkarni
4 Replies

10. Shell Programming and Scripting

Parsing a file based on positional constraints

I have a list file1 like dog cow fox cat fish duck crowI want to classify the elements of file1 based on constrains applied on file2. Additionally the number of elements (words) in the each line of file2 is not fixed. This is my file2 cow cat fox dog cow fox dog fish crow fox dog cat ... (5 Replies)
Discussion started by: sammy777
5 Replies
set_color(1)							       fish							      set_color(1)

NAME
set_color - set_color - set the terminal color set_color - set the terminal color Synopsis set_color [-v --version] [-h --help] [-b --background COLOR] [COLOR] Description Change the foreground and/or background color of the terminal. COLOR is one of black, red, green, brown, yellow, blue, magenta, purple, cyan, white and normal. o -b, --background Set the background color o -c, --print-colors Prints a list of all valid color names o -h, --help Display help message and exit o -o, --bold Set bold or extra bright mode o -u, --underline Set underlined mode o -v, --version Display version and exit Calling set_color normal will set the terminal color to whatever is the default color of the terminal. Some terminals use the --bold escape sequence to switch to a brighter color set. On such terminals, set_color white will result in a grey font color, while set_color --bold white will result in a white font color. Not all terminal emulators support all these features. This is not a bug in set_color but a missing feature in the terminal emulator. set_color uses the terminfo database to look up how to change terminal colors on whatever terminal is in use. Some systems have old and incomplete terminfo databases, and may lack color information for terminals that support it. Download and install the latest version of ncurses and recompile fish against it in order to fix this issue. Version 1.23.1 Sun Jan 8 2012 set_color(1)
All times are GMT -4. The time now is 10:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy