Sponsored Content
Full Discussion: Perl line switching
Top Forums Programming Perl line switching Post 302476665 by ab52 on Thursday 2nd of December 2010 08:02:44 AM
Old 12-02-2010
Perl line switching

Hi all

i have a text file with lots of data regarding the machine we have, each line is a seperate machine
for example here are a line ( all the data has been replaced with symbols for data protection)

Code:
@@@@@,£££££,%%%,^^^^,&&&&&&,*****,(((((,))))),------

!!!!!!!,£££££,%%%,^^^^,&&&&&&,*****,(((((,))))),------

as you can see each field id broken up with commas, i want a way to switch all the fields after the %%%, with another line

so i could type switch @ !!! and every after %%%, would switch around

thanks
Adam

Last edited by fpmurphy; 12-02-2010 at 10:00 AM.. Reason: fixed many typos
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl script to search a line and copy it to another line

Hi I have a log file (say log.txt). I have to search for a line which has the string ( say ERROR) in the log file and copy 15 lines after this into another file (say error.txt). Can someone give me the code and this has to be in PERL Thanks in advance Ammu (3 Replies)
Discussion started by: ammu
3 Replies

2. Shell Programming and Scripting

How to use Perl to join multi-line into single line

Hello, Did anyone know how to write a perl script to merge the multi-line into a single line where each line with start at timestamp Input--> timestamp=2009-11-10-04.55.20.829347; a; b; c; timestamp=2009-11-10-04.55.20.829347; aa; bb; cc; (5 Replies)
Discussion started by: happyday
5 Replies

3. Shell Programming and Scripting

perl/unix: script in command line works but not in perl

so in unix this command works works and shows me a list of directories find . -name \*.xls -exec dirname {} \; | sort -u | > list.txt but when i try running a perl script to run this command my $query = 'find . -name \*.xls -exec dirname {} \; | sort -u | > list.txt';... (2 Replies)
Discussion started by: kpddong
2 Replies

4. Programming

concatinate all lines from second line to end of line in perl

I have datafile like ~dta.yunm shhshsgggssssjsksjs sggsjshsjsjssss shshshhshshshs i wish to take only first line and all other lines in concatenated form in second line what should I do??? output like ~dta.yunm shhshsgggssssjsksjssggsjshsjsjssssshshshhshshshs please tell me how... (7 Replies)
Discussion started by: sujit_singh
7 Replies

5. Shell Programming and Scripting

PERL or SHELL Scrript to search in Directories by taking line by line from a text file

Unix box server version *********** >uname -r B.11.00 >echo $SHELL /usr/bin/ksh --> in this server, I have the path like /IMbuild/dev/im0serv1 ---> in that directory I have the folders startup(.jsp files nearly 100 jsp's ) and scripts(contains .js files nearly 100 files) ... (9 Replies)
Discussion started by: pasam
9 Replies

6. Shell Programming and Scripting

perl: comparision of field line by line in two files

Hi everybody, First I apologize if my question seems demasiad you silly, but it really took 4 days struggling with this, I looked at books, forums ... And Also ask help to a friend that is software developer and he told me that it is a bad idea do it by perl... but this is my problem. I moved to... (8 Replies)
Discussion started by: Thelost
8 Replies

7. Shell Programming and Scripting

Make Multile line is one line using window Perl

Hi All I have a .csv file which is showing data as ESP Client,ESP Engagement,Misc_Projects_120101,DEFAULT,HA,Unknown,No,Unknown,201704,4.1,Unknown,AAA,Collected-Done,"she,joy.",200111,Unknown,Full Time,,Delivery_DONE AMO,Approved,2012-12-03,2012-12-06,2012-12-06,"Occupied Hours ... (7 Replies)
Discussion started by: adisky123
7 Replies

8. Shell Programming and Scripting

Perl how to compare two pdf files line by line

Hi Experts, Would really appreciate if anyone can guide me how to compare two pdf files line by line and report the difference to another file. (3 Replies)
Discussion started by: prasanth_babu
3 Replies

9. Shell Programming and Scripting

Perl to extract information from a file line by line

In the below perl code I am using tags within each line to extract certain information. The tags that are used are: STB >0.8 is STRAND BIAS otherwise GOOD FDP is the second number GO towards the end of the line is read into an array and the value returned is outputed, in the first line that... (1 Reply)
Discussion started by: cmccabe
1 Replies

10. Shell Programming and Scripting

Perl command line option '-n','-p' and multiple files: can it know a file name of a printed line?

I am looking for help in processing of those options: '-n' or '-p' I understand what they do and how to use them. But, I would like to use them with more than one file (and without any shell-loop; loading the 'perl' once.) I did try it and -n works on 2 files. Question is: - is it possible to... (6 Replies)
Discussion started by: alex_5161
6 Replies
fence_vixel(8)						      System Manager's Manual						    fence_vixel(8)

NAME
fence_vixel - I/O Fencing agent for Vixel FC switches SYNOPSIS
fence_vixel [OPTION]... DESCRIPTION
fence_vixel is an I/O Fencing agent which can be used with Vixel FC switches. It logs into a Vixel switch via telnet and removes the spec- ified port from the zone. Removing the zone access from the port disables the port from being able to access the storage. fence_vixel accepts options on the command line as well as from stdin. fenced sends parameters through stdin when it execs the agent. fence_vixel can be run by itself with command line options which is useful for testing. After a fence operation has taken place the fenced machine can no longer connect to the Vixel FC switch. When the fenced machine is ready to be brought back into the GFS cluster (after reboot) the port on the Vixel FC switch needs to be enabled. In order to do this, log into the Vixel FC switch. Then go to: config->zones->config <port> <comma-separated-list-of-ports-in-the-zone> Then apply Consult the Vixel manual for details Vendor URL: http://www.emulex.com OPTIONS
-a IPaddress IP address of the switch. -h Print out a help message describing available options, then exit. -n port The port number to remove zoning from on the switch. -p password Password for login. -S path Full path to an executable to generate the password for login. -V Print out a version message, then exit. STDIN PARAMETERS
agent = < param > This option is used by fence_node(8) and is ignored by fence_vixel. ipaddr = < hostname | ip > IP address or hostname of the switch. passwd = < param > Password for login. passwd_script = < param > Full path to an executable to generate the password for login. port = < param > The port number to remove zoning from on the switch. SEE ALSO
fence(8), fence_node(8) fence_vixel(8)
All times are GMT -4. The time now is 01:34 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy