Sponsored Content
Top Forums Shell Programming and Scripting Find Data in test file and write each out to a line Post 302958857 by kcpoole on Monday 26th of October 2015 10:30:12 PM
Old 10-26-2015
That is excellent Don
Thank you for your help
Much simpler than what I was envisaging.

All I have to do now is to understand it all so I can embed it in my brain for nest time

Ken
This User Gave Thanks to kcpoole For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Extract data from an XML file & write into a CSV file

Hi All, I am having an XML tag like: <detail sim_ser_no_1="898407109001000090" imsi_1="452070001000090"> <security>ADM1=????</security> <security>PIN1=????</security> <security>PIN2=????</security> ... (2 Replies)
Discussion started by: ss_ss
2 Replies

2. Hardware

how to write data into a device file?

Hi, I am working in device drivers. I am new to device drivers. i have invoked chardev.c. the driver is insmoded. now i want to write something into this and i want to look what i have written. but i don't know how to write and see. please help me (0 Replies)
Discussion started by: boidi
0 Replies

3. Shell Programming and Scripting

Find line number of bad data in large file

Hi Forum. I was trying to search the following scenario on the forum but was not able to. Let's say that I have a very large file that has some bad data in it (for ex: 0.0015 in the 12th column) and I would like to find the line number and remove that particular line. What's the easiest... (3 Replies)
Discussion started by: pchang
3 Replies

4. Programming

How to write data to file in C?

Hi I want to open a file and write data in the following manner. Header String 1 String 2 String 3 String 4 String 5 ... (4 Replies)
Discussion started by: AAKhan
4 Replies

5. Homework & Coursework Questions

Shell script calling Perl function, sort and find data, write to new files

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: I must write a shell script that calls two external Perl functions--one of which sorts the data in a file, and... (6 Replies)
Discussion started by: kowit010
6 Replies

6. Shell Programming and Scripting

Find common entries in 2 list and write data before it

Hi all, I have 2 files: second file I want if entries in one file will match in other file. It shuld wite approve before it so output shuld be (1 Reply)
Discussion started by: manigrover
1 Replies

7. Shell Programming and Scripting

Find matches and write the data before it

Hi all I am here for help once again I have two files One file is like this with one columns F2 B2 CAD KGM HTC CSP Second file is like this in 5 columns where firs column contain sometime entries of first file with space and other entries (12 Replies)
Discussion started by: Priyanka Chopra
12 Replies

8. Shell Programming and Scripting

Write over data to new file

hi..i would ask about how to write over data to new file with BASH. so..assume my data looks like this : 11 12 13 14 15 ...and so on. It's always line by line. and that's for the first file. i want to write over those numbers into second file but by using space. so my second file should be... (5 Replies)
Discussion started by: syalala
5 Replies

9. Shell Programming and Scripting

Extract data from XML file and write in CSV file

Hi friend i have input as following XML file <?xml version="1.0"?> <Document xmlns="urn:iso:std:iso:20022:tech:xsd:camt.054.001.02"> <BkToCstmrDbtCdtNtfctn> <GrpHdr><MsgId>LBP-RDJ-TE000000-130042430010001001</MsgId><CreDtTm>2013-01-04T03:21:30</CreDtTm></GrpHdr>... (3 Replies)
Discussion started by: mohan sharma
3 Replies

10. Shell Programming and Scripting

Compare 2 text file with 1 column in each file and write mismatch data to 3rd file

Hi, I need to compare 2 text files with around 60000 rows and 1 column. I need to compare these and write the mismatch data to 3rd file. File1 - file2 = file3 wc -l file1.txt 58112 wc -l file2.txt 55260 head -5 file1.txt 101214200123 101214700300 101250030067 101214100500... (10 Replies)
Discussion started by: Divya Nochiyil
10 Replies
String::Truncate(3pm)					User Contributed Perl Documentation				     String::Truncate(3pm)

NAME
String::Truncate - a module for when strings are too long to be displayed in... VERSION
version 1.100600 SYNOPSIS
This module handles the simple but common problem of long strings and finite terminal width. It can convert: "this is your brain" -> "this is your ..." or "...is your brain" or "this is... brain" or "... is your b..." It's simple: use String::Truncate qw(elide); my $brain = "this is your brain"; elide($brain, 16); # first option elide($brain, 16, { truncate => 'left' }); # second option elide($brain, 16, { truncate => 'middle' }); # third option elide($brain, 16, { truncate => 'ends' }); # fourth option String::Trunc::trunc($brain, 16); # => "this is your bra" FUNCTIONS
elide elide($string, $length, \%arg) This function returns the string, if it is less than or equal to $length characters long. If it is longer, it truncates the string and marks the elision. Valid arguments are: truncate - elide at left, right, middle, or ends? (default: right) marker - how to mark the elision (default: ...) at_space - if true, strings will be broken at whitespace if possible trunc trunc($string, $length, \%arg) This acts just like "elide", but assumes an empty marker, so it actually truncates the string normally. IMPORTING
String::Truncate exports both "elide" and "trunc", and also supports the Exporter-style ":all" tag. use String::Truncate (); # export nothing use String::Truncate qw(elide); # export just elide() use String::Truncate qw(:all); # export both elide() and trunc() use String::Truncate qw(-all); # export both elide() and trunc() When exporting, you may also supply default values: use String::Truncate -all => defaults => { length => 10, marker => '--' }; # or use String::Truncate -all => { length => 10, marker => '--' }; These values affect only the imported version of the functions. You may pass arguments as usual to override them, and you may call the subroutine by its fully-qualified name to get the standard behavior. BUILDING CODEREFS
The imported builds and installs lexical closures (code references) that merge in given values to the defaults. You can build your own closures without importing them into your namespace. To do this, use the "elide_with_defaults" and "trunc_with_defaults" routines. elide_with_defaults my $elider = String::Truncate::elide_with_defaults(\%arg); This routine, never exported, builds a coderef which behaves like "elide", but uses default values when needed. All the valud arguments to "elide" are valid here, as well as "length". trunc_with_defaults This routine behaves exactly like elide_with_defaults, with one obvious exception: it retuns code that works like "trunc" rather than "elide". If a "marker" argument is passed, it is ignored. SEE ALSO
Text::Truncate does a very similar thing. So does Text::Elide. BUGS
Please report any bugs or feature requests through the web interface at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=String-Truncate>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. ACKNOWLEDGEMENTS
Ian Langworth gave me some good advice about naming things. (Also some bad jokes. Nobody wants String::ETOOLONG, Ian.) Hans Dieter Pearcey suggested allowing defaults just in time for a long bus ride, and I was rescued from boredom by that suggestion AUTHOR
Ricardo Signes <rjbs@cpan.org> COPYRIGHT AND LICENSE
This software is copyright (c) 2011 by Ricardo Signes. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. perl v5.10.1 2011-03-26 String::Truncate(3pm)
All times are GMT -4. The time now is 07:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy