General :: Combine Two Files Column-wise In Ubuntu?
Jul 7, 2011
I have two files: one is like
preface
Introduction
chapter 1
the other is like
1
2
3
I was wondering how to column-wise combine the two files into one:
preface 1
Introduction 2
chapter 1 3
by using some utilities, such as awk, sed, available in Ubuntu?
View 1 Replies
ADVERTISEMENT
Nov 17, 2010
I want to split file foo into two parts, and I only intersted in the first one. But the N bytes in which the first part consists, I want it to be an exact replica of the corresponding bytes of foo. More exactly:
Code:
foo foo1 foo2
==============================
90 90 05
[code]....
View 4 Replies
View Related
Jun 24, 2009
I would like to know the blocking methode In a Firewall or a Router.whether i will be done by Protocol wise, ho? or it will done through Host wise, How ?
View 2 Replies
View Related
Mar 22, 2011
Combine multiple text files into one text file?
View 5 Replies
View Related
Jan 11, 2011
How can I join the two parts of a stereoscopic movie to get a side-by-side one?
I can expand the left file, that way all I'll need is to paste the second one on top of it, with something like this:
mencoder left-file.mkv -o side-by-side.avi -oac copy -ovc lavc -of avi -vf scale=1280:720,expand=-1280:0:0:0 -sws 3 -lavcopts vbitrate=16000
Any idea which tool should I use on a Linux system?
View 1 Replies
View Related
Jun 12, 2011
I have hundreds of files in one directory, is there a simple command or pipes of command I can use to append them together? I don't want to use any loops.
View 4 Replies
View Related
Jul 19, 2010
How would i calculate following values.Initial file
10 3
20 4
How would i calculate 3rd column which should be addition of value in 1 and 2nd column.File after calculation
10 3 13
20 4 24
View 14 Replies
View Related
Mar 7, 2010
i use this script to get the time and date of back and fourth transactions for a particular execution id. I use a substr command on the 5th column to to cut the milli seconds off the time value. - otherwise the times would look like 08:30:04.235
grep <executionID> <auditfile> | awk '{ print $1, $2, $3, $4, substr($5,1,8}
FIX -> Mon 3/1/2010 08:30:04
FIX <- Mon 3/1/2010 08:32:36
FIX <- Mon 3/1/2010 08:35:08
[code].....
anyhow - i append two sed commands to further clarify the direction of the message.
awk '{ print $1, $2, $3, $4, substr($5,1,8} | sed -e 's/->/ ->IN/g' | sed -e 's/<-/<-OUT/g'
FIX -> IN Mon 3/1/2010 08:30:04
FIX <- OUT Mon 3/1/2010 08:32:36
[code]....
I tried using an awk gsub () command within the string instead of the two seds, but it did not work:
awk '{ print gsub(/<regex>/, <replace with>,$1), $2, $3, $4, substr($5,1,8}
the sed works ok, but it would be cooler to make the replacement within the awk command:
gsub(/->/,-> IN, $1)
Is there a way where i could replace the value of the $1 column in the awk print string?
View 1 Replies
View Related
Mar 21, 2011
This solution works but is slow with large files. I am looking for a faster solution.
The 2 files contain filenames, one of them has associated data I want to append to the other file's matching filenames
file1:
file2:
I append file2 by matching the unique_filenames and appending them with the tag data and some formatting
appended file2:
Here is the SLOW code
while read inputline.
View 9 Replies
View Related
Feb 15, 2010
I have two files which I would like to combine. Each file has 2 columns.
File 1:
1 a
2 b
[code]...
View 2 Replies
View Related
Feb 28, 2010
I have an audiobook in 64 small mp3 files and I need them combined into a single file of any format in the proper order or order that I add them in. What program can I use?
View 9 Replies
View Related
Nov 27, 2010
How to use ffmpeg or memcoder to join two .ogv files into a single .ogv ??Let's suppose the first .ogv video file is named as "01.ogv" and the resolution is 800*600;the second .ogv video file is named as "02.ogv" and the resolution is 720*576.I'd love to join two video files into a whole one, with the resolution 320*240.
View 1 Replies
View Related
Jun 8, 2011
My backup script generates 2 lengthy log file. They have the same name, but the date is appended. I want to select the oldest one, condense it with "head" and "tail" and then append the condensed version of the newer one. They seem to get tangled up.Code:
ls `find . -iname "bak-log_*"` -1t | tail -1
and
ls `find . -iname "bak-log_*"` -rt | tail -1
[code]...
View 2 Replies
View Related
May 18, 2010
I need to overwrite the first say 50 or so lines of an xml file on an everyday basis. The first 50 lines of the file are always the same and the 50 lines they get replaced with are always the same. Is there a way to create a file with the 50 new lines and somehow copy/merge/overwrite the larger file such that the 50 original lines would be replaced but the remainder of the file would be untouched?This seems simple, there has to be a way to do it. I'm just not smart enough to figure it out.
View 2 Replies
View Related
Apr 9, 2010
I have a problem with file names changes. I have a hundred of file with same names and different subdirectories. I want to change that file names by their subdirectery names.
Currently is:
file name------------------------subdirectory name
1_km_16_days_EVI_s2_01200_01200.img --> MOD13A2.A2000049.h23v03.005.dir
1_km_16_days_EVI_s2_01200_01200.img --> MOD13A2.A2000065.h23v03.005.dir
1_km_16_days_EVI_s2_01200_01200.img --> MOD13A2.A2000081.h23v03.005.dir
...
I want to
MOD13A2.A2000049.h23v03.005.img
MOD13A2.A2000065.h23v03.005.img
MOD13A2.A2000081.h23v03.005.img
View 3 Replies
View Related
Oct 31, 2010
I am working on a script that allows me to convert an IP address to a country name. I have 2 files. One that has text like: PORT.80 TCP SRC=x.x.x.x and the other is x.x.x.x United States. How can I combine these files so that the file output is PORT.80 TCP SRC=x.x.x.x United States?
View 5 Replies
View Related
Sep 20, 2010
I am doing a spreadsheet for work (for importing data into a new database) and I have hundreds of image files which need to have just their file names in one column called Product Code. Is it possible to use the ls command to list the contents of a directory in one single column so that I can copy and paste to the spread sheet?
Also, is there a single command to remove the file extentions for a batch of files? Bulk rename is what I need, I guess but just to remove the file extension (.jpg on all of them). The normal use of ls lists them in multiple column form and when I copy and paste those it will not let me copy just one cloumn at a time. The spreadsheet only has three columns:
New Product Code Old Product Code Pictures New Product Code will be left black, and the Old Product Code is just the image names. The picture column will be the patch-to-the-image for each image. I am not sure that is even possible in a spreadsheet.
View 14 Replies
View Related
Jul 15, 2010
I have a multicolumn datas, like
a1 b1 ... f1
a2 b2 ... f2
. . ... .
[code]...
I would like to make a file with all these data in one column, like
a1
a2
.
.
[code]....
Can it be done with awk or some other command? Also, is it possible then do add another column in front of this one with numbers of the lines (for every previous column), like
1 a1
2 a2
. .
. .
[code].....
View 14 Replies
View Related
May 5, 2011
Is there any Linux utility to combine two or more binary files into a single binary file ?
View 7 Replies
View Related
Apr 3, 2011
how to combine bash scripting with apache.
View 5 Replies
View Related
Oct 25, 2010
I am using Red Hat Linux enterpriser 4 using two physical LAN cards.There are two different ISP internet lines coming into a single gateway computer. Is it possible that if in our one network we are using 2 MB bandwidth and from another network we are getting 2 MB bandwidth.(Two different Networks) and combine it into 4 MB. In bonding it combine the bandwidth or it do loadbalancing ?
The question is can we accumulate or add these two bandwidth in Linux machine and it sent total bandwidth 4 to the end users ?
Lan Card A
IP Address: 192.168.1.250 2MB Bandwidth
l
l
l
[Code]....
View 2 Replies
View Related
Dec 2, 2010
I am trying to remove the space between the 2nd and 3rd fields but just cannot work out how to do it. I've considered sed, cut, awk...I know with sed you can replace all instances within a file but can you also specify to remove, say, the 2nd instance of a space in each line (this would be perfect for me)?
DAAE 60 402 Bejaia Algeria 1 36-43N 005-04E 36-43N 005-04E 2 2 P
DAAG 60 390 Dar-El-Beida Algeria 1 36-43N 003-15E 36-43N 003-15E 25 25 P
DAAJ 60 670 Djanet Algeria 1 24-33N 009-28E 24-33N 009-28E 1054 1054 P
[code]...
View 3 Replies
View Related
Mar 12, 2011
I have multiple noisy photos (caputed without tripod) that needs to be adjusted (moved/rotated) and averaged.
How it's better to do it in Linux with FOSS console-based programs?
Current way is something like:
mplayer mf://*.JPG -vo yuv4mpeg:file=qqq.yuv
transcode -i qqq.yuv -y null -J stabilize=maxshift=500:fieldsize=100:fieldnum=6:stepsize=50:shakiness=10
transcode -i qqq.yuv -J transform=smoothing=100000:sharpen=0:optzoom=0 -y raw -o www.yuv
Update: Experimented with "Hugin". It only distorted all photos according some "projection" and refused to merge them: enblend: excessive overlap detected; remove one of the images. Of course "excessive" - they're all almost in the same place. No averaging? /* and images are not actually aligned */.
Proceeding to experiments with enblend/panorama_tools/ale.
View 3 Replies
View Related
Nov 23, 2010
Ubuntu 10.10
Gnome desktop
On a text file, .txt, it is possible to high-light and copy a row on a table. But how to high-light and copy a column.
View 14 Replies
View Related
Feb 3, 2011
I just migrated to Ubuntu 10.04 from windows and I could not be more satisfied, except for one minor, nitpicky detail. In iTunes I was able to sort my music by "album by year". That is, my music was sorted primarily by artist, then by album year. So each artist had their albums listed in chronological order. My library is meticulously tagged, so every track on every album is tagged with the same YEAR value. Is this possible in Rhythmbox? Is there a plugin or will i have to edit a .conf file (or similar) somewhere? I'm new to Ubuntu, but not afraid of getting my hands a bit dirty, so to speak.
View 1 Replies
View Related
Jan 18, 2011
I have a two column file and I need to create a new column in between the first and second but the new column adds a value to the first. E.g.code...
I thought I had figured out how to do it with the following but it just hangs:
awk -F '{print $0,$0+25,$1}' file_in > file_out
Also tried the following to no avail:
awk -F,-v OFS,'{print $0,$0+25,$1}' file_in > file_out
I can add the new column with the added value to the last column easy ( awk '{print $0,$0+25}' file_in > file_out).
View 8 Replies
View Related
Feb 17, 2011
Is it wise to mix Squeeze stable with sid packages?Or is it better to install squeze testing and mix testing with sid?
View 5 Replies
View Related
May 13, 2011
I made a script to backup file from each host with general password in local network. This script using SSH Pass and Rsync with this
syntax:
rsync --rsh="sshpass -p password ssh -l root" hostath destinationpath
Everything is okay under 9.10 version until I migrate to Ubuntu 11.04, there is always give an error:
rsync error: received SIGINT, SIGTERM, or SIGHUP (code 20) at rsync.c(541) [Receiver=3.0.7]
I am using bash version: GNU bash, version 4.2.8(1)-release (i686-pc-linux-gnu) and 2.6.38-8-generic kernel
View 3 Replies
View Related
Oct 25, 2010
i have a M1730 with 2 HD in RAID 0. Windows 7 64bit installed. I tried to install Ubuntu 10.10 with WUBI, all ok the installation in Windows. Restarted the system I have 2 multiboot options with the new Ubuntu... it starts but in graphic mode it tries to finish the installation and stops with an error message like that: "root filesystem not defined...".The problem is the raid0 of my disks or other?
View 5 Replies
View Related
Sep 9, 2010
I just recently reinstalled openSUSE 11.3 last night with the GNOME desktop. Since I'm starting fresh again, I'd like to set up my System as flawless as possible.
So, my question is stated in the Title. How do you set System-Wide environment variables on OpenSUSE 11.3 // GNOME? I usually set them by adding an export to my ~/.bashrc, but I remember in Ubuntu that I could add them to /etc/environment. I checked that file out on my system, and it has a the default comment on it stating:
"This file is parsed by pam_env module...Syntax: simple "KEY=VAL" pairs on seperate lines"
This seems to be the spot to add my "export JAVA_HOME=/usr/java/..etc", etc. but I wanted to clarify before I went ahead and made any changes.
View 9 Replies
View Related