merging two .txt files by alternating x lines from file 1 and y lines from file2
Hi everyone,
I have two files (A and B) and want to combine them to one by always taking 10 rows from file A and subsequently 6 lines from file B. This process shall be repeated 40 times (file A = 400 lines; file B = 240 lines).
Does anybody have an idea how to do that using perl, awk or sed?
Thank you so much in advance!
Iris
------------------------------------------------------------------------------
File A
------------------------------------------------------------------------------
-------------------------------------------------------------------------------
File B
-------------------------------------------------------------------------------
Last edited by Franklin52; 05-26-2011 at 12:47 PM..
Reason: Please use code tags
Hi there,
I have a couple of files I need to merge. I can do a simple merge by concatenating them into one larger file.
But then I need to filter the file to get a desired result.
The output looks like this:
TRNH 0000000010941
ORDH
OADR
OADR
ORDL
ENDT 1116399 000000003... (2 Replies)
I need to write a script that reads through an input .txt file and replaces the end value with the end value of the next line for lines that have distance <=4000. The first label line is not actually in the input. In the below example, 3217 is the distance from the end of the first line to the... (12 Replies)
Hi,
I want to merge the lines starting with a comma symbol with the previous line of the file.
Input :
cat file.txt
name1,name2
,name3,name4
emp1,emp2,emp3
,emp4
,emp5
user1,user2
,user3
Output
name1,name2,name3,name4
emp1,emp2,emp3,emp4,emp5 (9 Replies)
I have about 20 CSV's that all look like this:
"","","","","","","","","","","","","","","",""What I've been told I need to produce is the exact same thing, but with each file now containing the start_code from every other file where the email matches.
It doesn't matter if any of the other... (1 Reply)
I have one base file, and multiple target files-- each have uniform line structure so no need to use grep to find things-- can just define sections by line number.
My question is quite simple-- can I use sed to copy a defined block of lines (say lines 5-10) from filename1.txt to overwrite an... (3 Replies)
I have a diff command that does what I want but when comparing large text/log files, it uses up all the memory I have (sometimes over 8gig of memory)
diff file1.txt file2.txt | grep '^<'| awk '{$1="";print $0}' | sed 's/^ *//'
Is there a better more efficient way to find the lines in one file... (5 Replies)
I have been working of this script for a very long time and I have searched the internet for direction but I am stuck here.
I have about 3000 files with two columns each. The length of each file is 50000. Each of these files is named this way b.4, b.5, b.6, b.7, b.8, b.9, b.10, b.11, b.12... (10 Replies)
Hello all,
I have a large csv file where there are four types of rows I need to merge into one row per person, where there is a column for each possible code / type of row, even if that code/row isn't there for that person.
In the csv, a person may be listed from one to four times... (9 Replies)
Recall that nc-county-pop.dat has 100 lines, and each line corresponds to a county. The files girls.dat and boys.dat each has 50 lines. Assume that the girls come from the first 50 counties and each county has only one girl. That is the first girl comes from the first county, the second girl comes... (1 Reply)
Hello All ,
I am trying to merge two files each contain 16 lakh lines ..My requirement is i have merge after every 14 lines of each file .
Like from file1 14 lines then after after 14 lines form file2 ..so i wrote below script .
It is working for small files ,but large files script not... (10 Replies)
Discussion started by: Phani369
10 Replies
LEARN ABOUT DEBIAN
pdl::gslsf::psi
PSI(3pm) User Contributed Perl Documentation PSI(3pm)NAME
PDL::GSLSF::PSI - PDL interface to GSL Special Functions
DESCRIPTION
This is an interface to the Special Function package present in the GNU Scientific Library.
Poly-Gamma Functions
psi(m,x) := (d/dx)^m psi(0,x) = (d/dx)^{m+1} log(gamma(x))
SYNOPSIS FUNCTIONS
gsl_sf_psi
Signature: (double x(); double [o]y(); double [o]e())
Di-Gamma Function psi(x).
gsl_sf_psi does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input
piddles.
gsl_sf_psi_1piy
Signature: (double x(); double [o]y(); double [o]e())
Di-Gamma Function Re[psi(1 + I y)]
gsl_sf_psi_1piy does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input
piddles.
gsl_sf_psi_n
Signature: (double x(); double [o]y(); double [o]e(); int n)
Poly-Gamma Function psi^(n)(x)
gsl_sf_psi_n does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input
piddles.
AUTHOR
This file copyright (C) 1999 Christian Pellegrin <chri@infis.univ.trieste.it> All rights reserved. There is no warranty. You are allowed to
redistribute this software / documentation under certain conditions. For details, see the file COPYING in the PDL distribution. If this
file is separated from the PDL distribution, the copyright notice should be included in the file.
The GSL SF modules were written by G. Jungman.
perl v5.14.2 2012-05-30 PSI(3pm)