Sponsored Content
Full Discussion: File formating with lines
Top Forums UNIX for Beginners Questions & Answers File formating with lines Post 302989883 by arunkumar_mca on Thursday 19th of January 2017 11:30:15 AM
Old 01-19-2017
File formating with lines

Hi All,

Need to modify a file basically join the extra line to one I am having a file like below

Quote:
A10
Records of transfer
File received
X,X,X,X,1,1,1,0,A.10,B.10,C.10,D.10,E.10,
F.10
X,X,X,X,1,1,1,0,A.11,B.11,C.11,D.11,E.11,
F.11
X,X,X,X,1,1,1,0,A.12,B.13,C.14,D.14,E.14,
F.14
And would like to make it as below .


Quote:
A10
Records of transfer
File received
X,X,X,X,1,1,1,0,A.10,B.10,C.10,D.10,E.10,F.10
X,X,X,X,1,1,1,0,A.11,B.11,C.11,D.11,E.11,F.11
X,X,X,X,1,1,1,0,A.12,B.12,C.12,D.12,E.12,F.12
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Help required on file formating

I have two files file1 and file2 as shown below: file1: name nameabc bcd nameabcdefg file2: age age1111 age2345 age6743 I have pasted one file on the other with the delimiter "|" and the resulttant file is: name|age nameabc|age1111 bcd|age2345 nameabcdefg|age6743 (1 Reply)
Discussion started by: udiptya
1 Replies

2. Shell Programming and Scripting

File formating question.

Hi, I have a file with only data 1 row: AA#?BB#?CC#?DD Assume '#?' is the delimiter, i want the output in another file to be: AA BB CC DD Pls let me know if this is possible by sed ? Thanks in advance. (3 Replies)
Discussion started by: smc3
3 Replies

3. Shell Programming and Scripting

file formating in Perl

Hi, I am new to unix , I have a requirement for formating the input file and generate the output file as per the downstream requirement .. My application receiving a text input file having 4 field and my application need to check each field and if some value of a field is blank ..then it need... (1 Reply)
Discussion started by: julirani
1 Replies

4. UNIX for Dummies Questions & Answers

File formating help needed.

I have a file called vm.cfg . content of file. acpi = 1 apic = 1 builder = 'hvm' How would i write a script which will add boot = 'd' at 3rd line. For example. after running the script the file should be like below. acpi = 1 apic = 1 boot = 'd' builder = 'hvm' I dont want to... (3 Replies)
Discussion started by: pinga123
3 Replies

5. Shell Programming and Scripting

File formating (sed command)

I am new ot unix. Is there one or two lines of command (sed may be) to format a file. My source is.. <tag1> <tag2> <datatag1> data1 </datatag1> <datatag2> data2 </datatag2> <datatag3> data3 </datatag3> <datatag4> data1 </datatag3> </tag2> </tag1> (2 Replies)
Discussion started by: reachsam11
2 Replies

6. Shell Programming and Scripting

Help in formating a txt file

Pls help in formatting a txt file using shell scripting Input file format: Name priya 2010-09-21 10:43:49 TEXT ID 1 hi TEXT ID 2 how TEXT ID 3 r TEXT ID 4 u Output required: name priya hi how r u (4 Replies)
Discussion started by: bha148
4 Replies

7. Shell Programming and Scripting

Help in formating a file with field separator

hi thanks a lot But pls help me if my input file is the below format: Name priya 2010-09-21 10:43:49 TEXT ID 1 hi TEXT ID 2 how TEXT ID 3 r TEXT ID 4 u Name2 priya2 2010-09-21 10:43:49 TEXT ID 1 hi1 TEXT ID 2 how1 TEXT ID 3 r1 (4 Replies)
Discussion started by: bha148
4 Replies

8. UNIX for Beginners Questions & Answers

File formating help

Hi all, I am having the file below I need that as below Thanks, Arun (12 Replies)
Discussion started by: arunkumar_mca
12 Replies

9. Shell Programming and Scripting

File formating

I need to create a fixed width file based on the column lengths. lets assume I have six(this may be dynamic) fields each are of different length column1=6 #size of the column column2=3 column3=2 column4=3 column5=4 column6=5 I tried below code snippet but it is not working echo... (4 Replies)
Discussion started by: gvkumar25
4 Replies

10. Shell Programming and Scripting

Help with ... Formating the file using awk

I have a file like below position1 0 7802 7802 0 client1 - - position1 8 8032 8032 0 client1 ... (7 Replies)
Discussion started by: manas_ranjan
7 Replies
File::Inplace(3)					User Contributed Perl Documentation					  File::Inplace(3)

NAME
File::Inplace - Perl module for in-place editing of files SYNOPSIS
use File::Inplace; my $editor = new File::Inplace(file => "file.txt"); while (my ($line) = $editor->next_line) { $editor->replace_line(reverse $line); } $editor->commit; DESCRIPTION
File::Inplace is a perl module intended to ease the common task of editing a file in-place. Inspired by variations of perl's -i option, this module is intended for somewhat more structured and reusable editing than command line perl typically allows. File::Inplace endeavors to guarantee file integrity; that is, either all of the changes made will be saved to the file, or none will. It also offers functionality such as backup creation, automatic field splitting per-line, automatic chomping/unchomping, and aborting edits partially through without affecting the original file. CONSTRUCTOR
File::Inplace offers one constructor that accepts a number of parameters, one of which is required. File::Inplace->new(file => "filename", ...) file The one required parameter. This is the name of the file to edit. suffix The suffix for backup files. If not specified, no backups are made. chomp If set to zero, then automatic chomping will not be performed. Newlines (actually, the contents of $/) will remain in strings returned from "next_line". Additionally, the contents of $/ will not be appended when replacing lines. regex If specified, then each line will be split by this parameter when using "next_line_split" method. If unspecified, then this defaults to s+. separator The default character used to join each line when replace_line is invoked with a list instead of a single value. Defaults to a single space. INSTANCE METHODS
$editor->next_line () In scalar context, it returns the next line of the input file, or undef if there is no line. In an array context, it returns a single value of the line, or an empty list if there is no line. $editor->replace_line (value) Replaces the current line in the output file with the specified value. If passed a list, then each valie is joined by the "separator" specified at construction time. $editor->next_line_split () Line "next_line", except splits based on the "regex" specified in the constructor. $editor->has_lines () Returns true if the file contains any further lines. $editor->all_lines () Returns an array of all lines in the file being edited. $editor->replace_all_lines (@lines) Replaces all remaining lines in the file with the specified @lines. $editor->commit () Completes the edit operation and saves the changes to the edited file. $editor->rollback () Aborts the edit process. $editor->commit_to_backup () Saves edits to the backup file instead of the original file. AUTHOR
Chip Turner, <chipt@cpan.org> COPYRIGHT AND LICENSE
Copyright (C) 2005 by Chip Turner This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.6.0 or, at your option, any later version of Perl 5 you may have available. POD ERRORS
Hey! The above document had some coding errors, which are explained below: Around line 283: You forgot a '=back' before '=head1' Around line 285: '=item' outside of any '=over' perl v5.16.3 2005-01-29 File::Inplace(3)
All times are GMT -4. The time now is 12:11 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy