Sponsored Content
Top Forums Shell Programming and Scripting Remove prefix per line in file Post 302406253 by EAGL€ on Monday 22nd of March 2010 11:58:53 AM
Old 03-22-2010
Quote:
Originally Posted by spidermike
ok thanks so far ... forgot to mention that I have 4 files with 4 different prefixes per line Smilie

so how about different prefixes, like BDD, BHD, BAD, BND?
all those starts with "B" n ends with "D" so might this work?

Code:
awk '{close(f);f=$1}{sub("^B[A-Za-z]D","");print > f".TXT"}' $_ftpfile

 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

remove filename prefix

I've got a bunch of files called oldabc, olddef etc. i want to copy these to be abc, def.... I can do this with file extensions....but can get the logic to work for prefixes. All the files I am interested in have a prefix of 'old'. This loop is no good for me....it looks at the content... (2 Replies)
Discussion started by: peter.herlihy
2 Replies

2. Shell Programming and Scripting

Remove prefix from filenames

I'm trying to put together a shell script that will append specific prefixes based on the content of filenames. I think I have this part down. However, I want to append before that part a process that will remove the current prefix before it renames the files with the new prefix. For example,... (6 Replies)
Discussion started by: HLee1981
6 Replies

3. Shell Programming and Scripting

Remove every third line from a file

I need to remove every second and every third line from a file. My idea was to do it in two operations. First every third line, then every second line. The problem is that i can't find out how to do it. I tried to look for some sed oneliners, but couldn't find any. Suggestions? (4 Replies)
Discussion started by: bistru
4 Replies

4. Shell Programming and Scripting

Remove header(first line) and trailer(last line) in ANY given file

Hi, I need some help in removing the header (first line) and the trailer (last line) in a give file... The data file actually comes in EBCDIC format and I converted it into ASCII.. Now I need to strip off the first line and the last line.. I think we can use sed to do something like this:... (2 Replies)
Discussion started by: madhunk
2 Replies

5. Shell Programming and Scripting

Remove prefix using awk

Remove prefix using awk File: nawk -F"|" '{if ($1 ~ /^xyz./) print; else { gsub(.*\..*, \..*, $1) ;print }}' file Error: ouput required: (5 Replies)
Discussion started by: pinnacle
5 Replies

6. Shell Programming and Scripting

Need awk script to add a prefix to each line in file

Hello , I have file with below content : '165567885', '165568443', '165568805', I need an awk script that would add a prefix zero after first ' . Like '0165567885', '0165568443', '0165568805', Please help. Thanks in advance. (5 Replies)
Discussion started by: rmv
5 Replies

7. Shell Programming and Scripting

Extract Uniq prefix from a start and end prefix

Dear All, assume i have a file with content: <Start>6000</Start> <Stop>7599</Stop> the output is: 6000 7000 7100 7200 7300 7400 7599 how should we use any awk, sed, perl can do this task, means to extract the uniq prefixes from the start and stop prefix. Thanks Jimmy (3 Replies)
Discussion started by: jimmy_y
3 Replies

8. Shell Programming and Scripting

Remove line from file and read file line by line

I have a file output.txt. File looks like this name1 10 name2 2 name3 5 I get a number n and I need to remove all lines which has number (after name) smaller or equal to n number. After that I need to write lines from file and my output must be like this: Output: 'name1 10' Output: 'name2... (1 Reply)
Discussion started by: kubo12312
1 Replies

9. UNIX for Beginners Questions & Answers

Remove first line of file

How can I use bash to remove the first line of a file? (3 Replies)
Discussion started by: locoroco
3 Replies
Test::BDD::Cucumber::Manual::Architecture(3pm)		User Contributed Perl Documentation	    Test::BDD::Cucumber::Manual::Architecture(3pm)

NAME
Test::BDD::Cucumber::Manual::Architecture - Structural Overview VERSION
version 0.11 INTRODUCTION
This short document exists to give you an idea how the different components of this distribution fit together. MODELS
The core of a Cucumber-based test suite are the feature files and the step definitions files. By convention, these are saved under "/features/" and "/features/step_definitions/" respectively. The feature files are encapsulated by the classes in "Test::BDD::Cucumber::Model". one to one TBCM::Feature<----------------->TBCM::Document | | +-------------------+ | | has many | has a | has many V | V TBCM::Scenario +----->TBCM::Line | ^ ^ +----------------------------+ | | has many | V | TBCM::Step---------------------------+ EXECUTOR
We build up a Test::BDD::Executor object, in to which we load the step definitions. We then pass this in a Test::BDD::Model::Feature object, along with a Test::BDD::Model::Harness object, which controls interaction with the outside world. AUTHOR
Peter Sergeant "pete@clueball.com" LICENSE
Copyright 2011, Peter Sergeant; Licensed under the same terms as Perl perl v5.14.2 2012-05-20 Test::BDD::Cucumber::Manual::Architecture(3pm)
All times are GMT -4. The time now is 07:35 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy