Sponsored Content
Top Forums Shell Programming and Scripting How to copy one file into another except some text Post 302550186 by AhmedLakadkutta on Thursday 25th of August 2011 01:36:45 AM
Old 08-25-2011
Question How to copy one file into another except some text

I have file input like-
Code:
abc,"123",""123","123","123","123","123","123","123","123","123","123","123","123",
abc,"123","123","123","123","123","123","123","123","123""123",abc etc

Input file consists of 1000 records and i want to copy into final file except abc
abc is at fixed position like 1,17,33,49 etc in short 1, (1+16) , (1+16+16) ,etc
How to do this, in efficient way using scripting??Smilie
Required output file:-
Code:
"123",""123","123","123","123","123","123","123","123","123","123","123","123"

Moderator's Comments:
Mod Comment This thread is not AIX specific, moving it to shell scripting area. Please use [code] and [/code] tags when posting code, data or logs etc. to preserve formatting and enhance readability, thanks.

Last edited by zaxxon; 08-25-2011 at 02:49 AM.. Reason: code tags
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

I want to copy the text output from a 'nohup.out' file.

Hello, I have a nohup.out file that, when executed, outputs a spreadsheet file with four-to-seven columns of number. I want to copy this output (in its entirety), so that I could then paste it on excel@ , or Notepad@. Please help, thanks. (3 Replies)
Discussion started by: Iamthe great
3 Replies

2. UNIX for Advanced & Expert Users

How to copy a string to a text file

I am using the following command to email a tex file as an attachment- cat mailtext.txt | elm -s "Subject" emailAddr where content of mailtext.txt is - "Body of email" This will attach foo.txt with the email. My problem is that the file foo.txt is ceated dynamically everytime with a... (5 Replies)
Discussion started by: hpuxlxboy
5 Replies

3. UNIX for Dummies Questions & Answers

Shell script to search for text in a file and copy file

Compete noob question.... I need a script to search through a directory and find files containing text string abcde1234 for example and then copy that file with that text string to another directory help please :eek: (9 Replies)
Discussion started by: imeadows
9 Replies

4. Shell Programming and Scripting

How to copy text with ed to new file ?

Alright, so in ed i do a subsititution: ed file << 'HERE' s/.*h2.*>\(.*\)<.*/\1/p HERE This gives me my desired line: Errors found while checking this document as XHTML 1.0 Transitional! But how would i put this line in a temporary file ? (4 Replies)
Discussion started by: Bertieboy7
4 Replies

5. Homework & Coursework Questions

copy files inside a text file

Hi Guys , I am new to this and Hi to all ,Need your help I am trying to copy Files which are inside file.txt The files inside file.txt are inthe below order file1.log file2.log file3.log ....... I want to copy these files to an output Directory , Please help (1 Reply)
Discussion started by: hc17972
1 Replies

6. Homework & Coursework Questions

copy files inside a text file

Hi Guys , I am new to this and Hi to all ,Need your help I am trying to copy Files which are inside file.txt The files inside file.txt are inthe below order file1.log file2.log file3.log ....... I want to copy these files to an output Directory , Please help (1 Reply)
Discussion started by: hc17972
1 Replies

7. Shell Programming and Scripting

Copy selective lines from text file

Hello, I have a text file which I need to check for presence of certain tags, and then copy a subsequent portion of text into another file. The tag matching canbe done with Grep but I do not know how to copy selective lines from one file to another. Is it possible do that? I checked up some... (8 Replies)
Discussion started by: ajayram
8 Replies

8. UNIX for Dummies Questions & Answers

Hoe to copy selected strings from file into another text file

Hi Experts, I just want to copy some selected strings from a a file into a new .txt file . I am using below command to find the data now want to copy the search results into another .txt file please help me . find /Path -exec grep -w "filename1|filename1|filename1|" '{}' \;... (2 Replies)
Discussion started by: mumakhij
2 Replies

9. Shell Programming and Scripting

Copy text and create new file

I have a directory with ~500 files that look like below. I need to copy each unique entry up until the second_ only once and put a .txt in place of the _. I am not quite sure how but have the below as a startThank you :). cp -u file1.txt "$(cat output.txt)" file1.txt ... (4 Replies)
Discussion started by: cmccabe
4 Replies

10. Shell Programming and Scripting

Copy text from web page and add to file

I need help to make a script for Ubuntu to OSCam that copy the text on this website that only contains "C: ip port randomUSERNAME password" and want to exclude the text "C:" and replace the rest with the old in my test.server file. (line 22) device = ip,port (line 23) user =... (6 Replies)
Discussion started by: baxarn
6 Replies
MSGFMT_PARSE(3) 							 1							   MSGFMT_PARSE(3)

MessageFormatter::parse - Parse input string according to pattern

	Object oriented style

SYNOPSIS
public array MessageFormatter::parse (string $value) DESCRIPTION
Procedural style array msgfmt_parse (MessageFormatter $fmt, string $value) Parses input string and return any extracted items as an array. PARAMETERS
o $fmt - The message formatter o $value - The string to parse RETURN VALUES
An array containing the items extracted, or FALSE on error EXAMPLES
Example #1 msgfmt_parse(3) example <?php $fmt = msgfmt_create('en_US', "{0,number,integer} monkeys on {1,number,integer} trees make {2,number} monkeys per tree"); $res = msgfmt_parse($fmt, "4,560 monkeys on 123 trees make 37.073 monkeys per tree"); var_export($res); $fmt = msgfmt_create('de', "{0,number,integer} Affen auf {1,number,integer} Baumen sind {2,number} Affen pro Baum"); $res = msgfmt_parse($fmt, "4.560 Affen auf 123 Baumen sind 37,073 Affen pro Baum"); var_export($res); ?> Example #2 OO example <?php $fmt = new MessageFormatter('en_US', "{0,number,integer} monkeys on {1,number,integer} trees make {2,number} monkeys per tree"); $res = $fmt->parse("4,560 monkeys on 123 trees make 37.073 monkeys per tree"); var_export($res); $fmt = new MessageFormatter('de', "{0,number,integer} Affen auf {1,number,integer} Baumen sind {2,number} Affen pro Baum"); $res = $fmt->parse("4.560 Affen auf 123 Baumen sind 37,073 Affen pro Baum"); var_export($res); ?> The above example will output: array ( 0 => 4560, 1 => 123, 2 => 37.073, ) array ( 0 => 4560, 1 => 123, 2 => 37.073, ) SEE ALSO
msgfmt_create(3), msgfmt_format(3), msgfmt_parse_message(3). PHP Documentation Group MSGFMT_PARSE(3)
All times are GMT -4. The time now is 11:13 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy