Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Cut paste from one file to other Post 302479850 by swapsb on Monday 13th of December 2010 05:35:12 AM
Old 12-13-2010
ROHON and ctsgnb

I got sample file from funtional guy which look like

Quote:
01,,BNZA,101103,0400,1,78,78/
02,BNZA,084-004,1,101102,0000/
03,047316555,AUD,015,000,100,11164907,102,100,400/
88,11164907,402,500,500,000,501,000,502/
88,000,503,000,965,000,966,400/
88,967,000,968,000,969,000/
16,930,11164907,0,0,FROM: 04-737-7577
16,475,60000,0,0046887/
16,501,6512446,0,0,FD000004793
16,501,3719353,0,0,002150010544
16,501,632224,0,0,002150010742
16,501,240884,0,0,002150010741
49,44660628,44660228/
03,047374624,AUD,015,000,100,000,102,000,400/
88,000,402,000,500,000,501,000,502/
88,000,503,000,965,000,966,400/
88,967,000,968,000,969,000/
49,400,000/
03,047377710,AUD,015,000,100,86840225,102,13100,400/
88,86840225,402,5900,500,000,501,000,502/
88,000,503,000,965,000,966,400/
88,967,000,968,000,969,000/
16,915,91695,0,000000000002/
16,915,228465,0,000000000009/
16,915,6955,0,000000000011/
16,915,106620,0,000000000013/
16,915,41830,0,000000000016/
16,915,224650,0,000000000017/
16,915,112085,0,000000000019/
16,915,25750,0,000000000049/
16,915,8440,0,000000000059/
16,915,81200,0,000000000081/
16,915,114480,0,000000000086/
49,347380300,347379900/
98,1058972775,3,1058972775/
99,1898953341,1,272,1898948248/

whenever i give account number (which will be second field on record id 03), all records for that account number (from line 03 to line 49) should be cut paste to new file
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

cut & paste

hi i am new to shell scripting, i have been trying to cut columns numbered 1,4 of a file consisiting of 4 columns. Each column is seperated by 2 spaces. for example: john 6102097199 tennessee usa michel 6734590899 texas USA now, i need to cut the name... (3 Replies)
Discussion started by: t_harsha18
3 Replies

2. Shell Programming and Scripting

cut and paste?

hi, I have a file with content like this for an employee: EmployeeID 101 Day_type, day vacation,1/2/2009 sick day, 3/2/2009 personal day, 4/5/2009 jury duty day, 5/5/2009 how do I make the result to show: EmployeeID,Day_type,day 101,vacation,1/2/2009 101,sick day,... (6 Replies)
Discussion started by: jbchen
6 Replies

3. Shell Programming and Scripting

cut and paste

Hi, Need a help with shell script. I have to search for a string in one of the file, if match found, copy the line to a new file and delete the line from the exisiting file. eg: 83510000000000063800000.1800000.1600000.1600000.2400000.1800000.2000000.21... (6 Replies)
Discussion started by: gpaulose
6 Replies

4. UNIX for Dummies Questions & Answers

Need help with using cut and paste command

I have a file which contains 3 fields separated by tabs example andrew kid baker I need to swap kid and baker using cut and paste commands how is this to be done? Thanks (1 Reply)
Discussion started by: drew211
1 Replies

5. Shell Programming and Scripting

need help with cut and paste command

I have a file which contains 3 fields separated by tabs example andrew kid baker I need to swap kid and baker using cut and paste commands how is this to be done? Thanks (3 Replies)
Discussion started by: drew211
3 Replies

6. Shell Programming and Scripting

Help required the cut the whole contents from one file and paste it into new file

Hi, First of all sincere apologies if I have posted in a wrong section ! Please correct me if I am wrong ! I am very new to UNIX scripting. Currently my problem is that I have a code file at the location /home/usr/workarea/GeneratedLogs.log :- Code :- (Feb 7, 571 7:07:29 AM),... (4 Replies)
Discussion started by: acidburn_007
4 Replies

7. Shell Programming and Scripting

Cut and paste data in new file

HI Guys, I have file A: Abc XyZ Abc Xyz Kal Kaloo Abc XyZ Abc Xyz Kalpooo Abc XyZ Abc Xyz Kloo Abc Abc Klooo I want file B Abc XyZ Abc Xyz Kal Kaloo Abc XyZ Abc Xyz Kalpooo Abc XyZ Abc Xyz Kloo File A is now 1 lines Abc Abc Klooo Cut all lines which have xyz... (2 Replies)
Discussion started by: asavaliya
2 Replies

8. Shell Programming and Scripting

Cut, replace and Paste a String from one file to another

I need to cut all the Strings in one file and Paste it in the another file in the Specific line by replacing the specific String. For Example Step 1: From the newfile.txt, i need to copy all the strings newfile.txt How are you, I am fine, How is your work newfle2.txt Hello david,... (2 Replies)
Discussion started by: Padmanabhan
2 Replies

9. Shell Programming and Scripting

Problem in cut or paste

Hello, I have some problem in cut or paste command for my text data. Input1.txt : I use cut command : cut -d ' ' -f1 Input1.txt > result.txt result.txt : Then, I use paste command to merge result.txt. paste -d ' ' result.txt Input1.txt > output.txt output.txt showed : I use cut... (1 Reply)
Discussion started by: awil
1 Replies

10. Shell Programming and Scripting

How to cut a pipe delimited file and paste it with another file to form a comma separated outputfile

Hello ppl I have a requirement to split (cut in unix) a file (A.txt) which is a pipe delimited file into A1.txt and A2.txt Now I have to join (paste in unix) this A2.txt with external file A3.txt to form output file A4.txt which should be CSV (comma separated file) so that third party can... (25 Replies)
Discussion started by: etldev
25 Replies
PASTE(1)						      General Commands Manual							  PASTE(1)

NAME
paste - paste multiple files together SYNOPSIS
paste [-s] [-d list] file... OPTIONS
-d Set delimiter used to separate columns to list. -s Print files sequentially, file k on line k. EXAMPLES
paste file1 file2 # Print file1 in col 1, file2 in col 2 paste -s f1 f2 # Print f1 on line 1 and f2 on line 2 paste -d : file1 file2 # Print the lines separated by a colon DESCRIPTION
Paste concatenates corresponding lines of the given input files and writes them to standard output. The lines of the different files are separated by the delimiters given with the option -s. If no list is given, a tab is substituted for every linefeed, except the last one. If end-of-file is hit on an input file, subsequent lines are empty. Suppose a set of k files each has one word per line. Then the paste output will have k columns, with the contents of file j in column j. If the -s flag is given, then the first file is on line 1, the second file on line 2, etc. In effect, -s turns the output sideways. If a list of delimiters is given, they are used in turn. The C escape sequences , , \, and are used for linefeed, tab, backslash, and the null string, respectively. PASTE(1)
All times are GMT -4. The time now is 04:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy