Sponsored Content
Top Forums Shell Programming and Scripting Perl : split flat line's to $ Post 302127886 by matrixmadhan on Friday 20th of July 2007 02:32:55 AM
Old 07-20-2007
Code:
perl -e ' while (<>) { chomp; my @arr = split(/ /); print "\"$arr[0]\" \"$arr[1]\" \""; for ( my $i = 2; $i <= $#arr; $i++ ) { print " $arr[$i]" }; print " \"\n" } ' filename

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

remove specific lines from flat file using perl

Hi, Here is wat im looking for.. i have a flat file which looks like this.. 00 * * * * .. .. * * text text text COL1 COL2 ----- ----- 1 a (12 Replies)
Discussion started by: meghana
12 Replies

2. UNIX for Dummies Questions & Answers

how to remove the first line from a flat file ?

Hi, I want to remove the first line from a flat file using unix command as simple as possible. Can anybody give me a hand ? Thanks in advance. xli (21 Replies)
Discussion started by: xli
21 Replies

3. Shell Programming and Scripting

Split a line on positions before reading complete line

Hi, I want to split before reading the complete line as the line is very big and its throwing out of memory. can you suggest. when i say #cat $inputFile | while read eachLine and use the eachLine to split its throwing out of memory as the line size is more than 10000000 characters. Can you... (1 Reply)
Discussion started by: vijaykrc
1 Replies

4. Shell Programming and Scripting

Split positional flat file.

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... (6 Replies)
Discussion started by: meetmedude
6 Replies

5. Shell Programming and Scripting

[Perl] Split lines into array - variable line items - variable no of lines.

Hi, I have the following lines that I would like to see in an array for easy comparisons and printing: Example 1: field1,field2,field3,field4,field5 value1,value2,value3,value4,value5Example 2: field1,field3,field4,field2,field5,field6,field7... (7 Replies)
Discussion started by: ejdv
7 Replies

6. Shell Programming and Scripting

Sort flat file by 3rd column in perl

Hello Guys I want to sort a flat file by the third column (numeric ) and store it in some other name I/P 9924873|20111114|00000000000013013|130|13|10/15/2010 12:36:22|W860944|N|00 9924873|20111114|00000000000013009|130|09|10/15/2010 12:36:22|W860944|N|00... (12 Replies)
Discussion started by: Pratik4891
12 Replies

7. Shell Programming and Scripting

perl: Read array from a flat file

Hello Guru's I want to read an array into a flatfile Please let me know how to do the same So far this the below code use strict; use warnings; open (my $data , '<', $ARGV)|| die "could not open $ARGV:\n$!"; my @array=(<$data>); my @sorted=sort... (8 Replies)
Discussion started by: Pratik4891
8 Replies

8. Shell Programming and Scripting

gnuplot flat line graph

Hi, I'm not able to find a solution because I cant find the exact keyword for this. I wanna make a graph like ive shown in the attachment. Could someone please share ideas on how to do this. Thanks! (3 Replies)
Discussion started by: jamie_123
3 Replies

9. Shell Programming and Scripting

Get line number in flat file

Hi, Is there a way to find out the line number from where the data starts? like if the data contains column header, irrespective of the text in the column header we should get the line number from which contains the column header. I am sorry if I haven't explained the problem clearly. ... (8 Replies)
Discussion started by: kedar_laveti
8 Replies

10. Shell Programming and Scripting

Perl split and add new line

Hi All, I find the below code printing the output of a particular field in same line, which i want it to be printed on a new line. ---CODE START--- foreach $defectRec (@outLs) { my($def_id,$status,$files_mod) = split(/,/, $defectRec); print "DEFECT ID: $def_id, Status:... (3 Replies)
Discussion started by: nmattam
3 Replies
nfsstat(8)						      System Manager's Manual							nfsstat(8)

NAME
nfsstat - Network File System statistics SYNOPSIS
/usr/bin/nfsstat [-i interval] [-23cnsrz] [system] OPTIONS
Displays summary information at the specified interval. Displays client NFS and RPC information, unless otherwise specified by either the -n or -r option. Displays server NFS and RPC information, unless otherwise specified by either the -n or -r option. Displays NFS client and server information, unless otherwise specified by either the -c or -s option. Displays RPC information for the client and server side, unless otherwise specified by either the -c or -s option. Specifies NFS version 2 statistics when specified with the -n option. If neither the -2 nor -3 option is specified, version 2 and version 3 statistics are displayed. Specifies NFS version 3 statistics when specified with the -n option. If neither the -2 nor -3 option is specified, version 2 and version 3 statistics are displayed. Reinitializes statis- tics. Used to set NFS client/server or RPC client/server statistics to zero. You must be logged in as superuser to use this command. DESCRIPTION
The nfsstat command displays statistical information about the Network File System (NFS) and Remote Procedure Call (RPC) interfaces in the kernel (by reading /dev/kmem). It can also be used to reinitialize this information. If no options are given, nfsstat displays both server RPC and NFS version 2 and version 3 information, and client RPC and NFS version 2 and version 3 information. The system argument specifies the file containing the system's name list. Otherwise, /vmunix is used. FILES
Specifies the kernel memory. nfsstat(8)
All times are GMT -4. The time now is 10:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy