Sponsored Content
Full Discussion: Perl parsing help required.
Top Forums UNIX for Advanced & Expert Users Perl parsing help required. Post 302595693 by suverman on Saturday 4th of February 2012 08:14:54 AM
Old 02-04-2012
Perl parsing help required.

Hello, I got a file like this.


5201
5202
5203
5204
1234
2345
3456
4567
6210
6220
6230
6240


The required output should be

5201 1234 6210
5202 2345 6220
5203 3456 6230
5204 4567 6240


I have huge files where patterns repeat in the same column,
like first x numbers of items would be column1, next x numbers be
column 2 etc. X varies with different files. Can I get an example code.

Thanks a ton.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

perl help required

hi previously this program used to ask for user input to perform operation so i have done the modifications but problem is that i have to create new file and redirect that file as input to this file and i want to avoid that so i made following modifications in program and i am not sure if its... (1 Reply)
Discussion started by: zedex
1 Replies

2. Shell Programming and Scripting

Perl parsing compared to Ksh parsing

#! /usr/local/bin/perl -w $ip = "$ARGV"; $rw = "$ARGV"; $snmpg = "/usr/local/bin/snmpbulkget -v2c -Cn1 -Cn2 -Os -c $rw"; $snmpw = "/usr/local/bin/snmpwalk -Os -c $rw"; $syst=`$snmpg $ip system sysName sysObjectID`; sysDescr.0 = STRING: Cisco Internetwork Operating System Software... (1 Reply)
Discussion started by: popeye
1 Replies

3. Shell Programming and Scripting

Perl Script required...

Hi All, Windows Platform. Perl Scripting. I have a file called 'hostnames.txt' contains hostname entries one by one line. Script has to perform the following command for each entry in that file. ovtopofix -G <hostname> Please anybody give me the script on this requirement. Thanks,... (1 Reply)
Discussion started by: ntgobinath
1 Replies

4. UNIX for Advanced & Expert Users

Perl - Help required

I am trying to upload a file to a SQL database table. The column type is IMAGE. I am looking for a solution to upload a word doc file. I tried 3 approaches. 1) my $fileToStore = "mytest.doc"; open IPFILE, "<", $name; binmode IPFILE; while (<IPFILE>) { $fileToStore .= $_; } close IPFILE;... (1 Reply)
Discussion started by: b.paramanatti
1 Replies

5. Shell Programming and Scripting

perl required output

Hi, I have a string in log file from that i need to pick the username. the string is like this-- pid 2172 tid 3124: 160: 10110847: userName : pid 2172 tid 3124: 160: 10110847: userName : pid 2172 tid 3124: 160: 10110847: userName : pid 2172 tid 3124: 160: 10110847: userName : pid... (5 Replies)
Discussion started by: namishtiwari
5 Replies

6. Shell Programming and Scripting

Parsing information in perl

So i'm trying to write a perl script that logins into a network switch via ssh: #sh ip traffic IP statistics: Rcvd: 1460119147 total, 563943377 local destination 0 format errors, 0 checksum errors, 48401998 bad hop count 0 unknown protocol, 8379279 not a gateway ... (2 Replies)
Discussion started by: streetfighter2
2 Replies

7. Shell Programming and Scripting

Help required in parsing a csv file

Hi Members, I am stuck with the following problem. Request your kind help I have an csv file which contains, 1 header record, data records and 1 footer record. Sample is as below Contents of cm_update_file_101010.csv -------------------------------------------------- ... (6 Replies)
Discussion started by: ramakanth_burra
6 Replies

8. Shell Programming and Scripting

PERL: Help required exact match

Hello, My requirement is to iterate over all the lines of a file and compare them with a word and perform some operations if exact match is found. For the snippet below, it works even if contents of line include "diff" and "diff:". I want it to work only if it is exactly "diff" and is not... (2 Replies)
Discussion started by: sarbjit
2 Replies

9. Shell Programming and Scripting

Perl script required for processing the data

I have following result.log file (always has 2 lines) which I need to process, cat result.log name.cmd.method,"result","abc","xyz"; name="hello,mine.12345,"&"tree"&" xyz "&" tree "&" xyz", data="way,"&" 1"&"rate-me"&"1"&"rate-me",str="",ret=""; now I need to extract the strings/data as... (4 Replies)
Discussion started by: perlDiva
4 Replies

10. Shell Programming and Scripting

Xsltproc showing error in parsing xml...help required

I need to parse text between xml tags using xsltproc. It seems the easiest way. Here the Input file looks like <?xml version="1.0" ?> - <tag:ROOT xmlns:as="http://some.org/some.xsd" xmlns:tag="http://www.tag.org/schemas" xmlns:xs="http://some.org/"> - <tag:L1> - <tag:L2> - <tag:L3> ... (2 Replies)
Discussion started by: alpha_1
2 Replies
DH_MAKECLILIBS(1)				Debhelper for CLI (Common Language Infrastructure)				 DH_MAKECLILIBS(1)

NAME
dh_makeclilibs - automatically create clilibs file SYNOPSIS
dh_makeclilibs [debhelper options] [-r] [-V[dependancies]] [-mminversion] [-lnextincompatible] [-Xitem] DESCRIPTION
dh_makeclilibs is a debhelper program that automatically scans for versioned CIL (.NET) assemblies, and generates a clilibs file for the libraries it finds. By default, dh_makeclilibs scans the .dll files in the package directories and writes the discovered compatibility data (major/minor, build, token) to "clilibs" files in the appropriate packages. However, if a file like debian/package.clilibs is found, this one will be installed and no scanning is performed. OPTIONS
-V, -Vdependancies --version-info, --version-info=dependancies By default, the clilibs file generated by this program does not make packages depend on any particular version of the package containing the assembly. It may be necessary for you to add some version dependency information to the clilibs file. If -V is specified with no dependency information, the current version of the package is plugged into a dependency that looks like "packagename (>= packageversion)". If -V is specified with parameters, the parameters can be used to specify the exact dependency information needed (be sure to include the package name). Beware of using -V without any parameters; this is a conservative setting that always ensures that other packages' shared library dependencies are at least as tight as they need to be, so that if the maintainer screws up then they won't break. The flip side is that packages might end up with dependencies that are too tight and so find it harder to be upgraded. -mminversion Like -V, but specifies only the version string, the package name comes from the package that is actually processed. This option is more flexible if you try to set a range of valid versions for different assembly packages coming from one source package. -lnextincompatible Specifies the (expected) version of this package when the compatibility to the current assemblies will break. -r An experimental option to automaticaly guess the next incompatible upstream version and insert them (like working with -l and -m options, see above). Do not expect the guessed values to be always correct - normally, the usualy assumed version string has the form generation.major.minor where versions with changes in "minor" are compatible and "major" versions break with compatibility. -Xitem, --exclude=item Exclude files that contain "item" anywhere in their filename or directory from being treated as shared libraries. --internal-mono Uses the Mono runtime in . (used for bootstrapping Mono packages) EXAMPLES
dh_makeclilibs Assuming this is a package named libfoobar0.9x-cil, generates a clilibs file that looks something like: libfoobar 1.0.2345.0_23a12f34 libfoobar0.9x-cil dh_makeclilibs -V Assuming the current version of the package is 0.93-3, generates a clilibs file that looks something like: libfoobar 1.0.2345.0_23a12f34 libfoobar0.9x-cil (>= 0.93-3) dh_makeclilibs -V 'libfoobar0.9x-cil (>= 0.92)' Generates a clilibs file that looks something like: libfoobar 1.0.2345.0_23a12f34 libfoobar0.9x-cil (>= 0.92) Assuming that your package creates libfoobar-cil and liblafasel-cil, which are compatible to 0.92 versions but the upstream is going to break compatibility in the next version, 0.94: dh_makeclilibs -m 0.92 -l 0.94 Generates clilibs file that looks something like: libfoobar 1.0.2345.0_23a12f34 libfoobar-cil (>= 0.92), libfoobar-cil (<< 0.94) and liblafasel 1.0.2345.0_23a12f34 liblafasel-cil (>= 0.92), liblafasel-cil (<< 0.94) SEE ALSO
debhelper(7) This program is a part of cli-common-dev. KNOWN BUGS
Will possibly not work correctly with DH_COMPAT levels 1 and 2. AUTHOR
Mirco Bauer <meebey@meebey.net>, Eduard Bloch <blade@debian.org>, inspired by dh_makeshlibs by Joey Hess <joeyh@debian.org> perl v5.14.2 2012-01-17 DH_MAKECLILIBS(1)
All times are GMT -4. The time now is 10:19 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy