由买买提看人间百态

topics

全部话题 - 话题: outputfile
(共0页)
i*e
发帖数: 352
1
来自主题: Programming版 - 脚本问题求教
想了两个,不知道可行否
sed 's/s+/t/g; s/t/n/2' inputfile > outputfile
awk -F '[[:blank:]]+' '{OFS="t"; print $1,$2"n"$3,$4}' inputfile >
outputfile
e****e
发帖数: 179
2
【 以下文字转载自 Linux 讨论区 】
发信人: engine (boxing cat), 信区: Linux
标 题: help on replacing text in a file
发信站: BBS 未名空间站 (Wed Oct 31 11:42:35 2007)
I would like to replace string 1 with string 2 in file3.dat, here is what I
did:
#!/usr/bin/perl
@inputfile= ("string1");
@outputfile=("string2");
@attfile=("file3.dat");
$mytempfile=$inputfile[0];
$youtempfile=$outputfile[0];
$hisfile=$attfile[0];
perl -pi -e 's/$mytempfile/$youtempfile/' $hisfile;
The program reports an error:
Scalar found where operator ex
r*******b
发帖数: 78
3
来自主题: JobHunting版 - 一道面试题求解
遇到一道简单的面试题,不太明白。
编写一个program
对一个input file,有如下内容:
blabla
_a_ val1 data1
_a_ val2 data2
_a_ val3 data3
最后要得到一个outputfile
val1, val2, val3
data1, data2, data3
希望你直接输入
./program output
语言随便你选。
小弟一直用c语言写代码。
请高手指导一下,是不是用python写完之后,用bash?
我的想法是matlab,然后转换成script,不知道行不行
谢谢赐教!
a********e
发帖数: 15
4
tr -d '\r' < inputfile > outputfile
v*****r
发帖数: 1119
5
来自主题: Linux版 - 求助文件切割问题
凑个热闹,如果楼主需要切割任意长的文件,scripting is necessary, perl or
python can do the job nicely but a little bit overkill. AWK 是做这种工作的最
好选择之一,只需要一行 code:
awk 'BEGIN {f=10;l=f+1949;}{if(NR<=l && NR>=f) print >(f"_"l".txt"); else
if(NR>l) f=l+10;l=f+1949;}' < inputfile.txt
说明:
1. 要被切割的是 inputfile.txt
2. 新产生的 outputfiles will take the format of .txt,
for example, 10_1959.txt,1969_3918.txt,3928_5877.txt and so on...
R****a
发帖数: 199
6
来自主题: Linux版 - 新手问:mysql和shell
depends on your setting, but you can try the following:
in shell, use the command,
mysql --database=$dbname -p$pswd -e "$yourquer" > $outputfile
Then you try to send this output file to a mail recipient.
l*******G
发帖数: 1191
7
来自主题: Linux版 - shell 的替换命令怎么用
试试
sed -e 's/\/-//' inputfile > outputfile
s*******f
发帖数: 757
8
来自主题: Programming版 - Usage of Grep???help!!!
I have data files with format like this:
year,mon,day,data.....
All are numbers and are seperated by coma. Can someone give me some suggestion
how I can use grep to extract the data at certain month, say, March-May.
I tried :
grep "^[[:digit:]\{\4\}[, ][3-5]]" inputfile >outputfile
It doesn't work.
Thanks!!!
a**n
发帖数: 313
9
来自主题: Programming版 - Usage of Grep???help!!!
awk -F, '{if($2==4 || $2==5) print}' inputfile > outputfile
d******e
发帖数: 2265
10
来自主题: Programming版 - Python 中如何调用C的 exe 程序
subprocess, redirect is kind of tricky and hard.
search subprocess redict will give you lots of hints.
I personally like the
with blah as blah:
call(blahlist, outputfile= blah)
way
n*****d
发帖数: 956
11
Linux下有adobe?
手动ps2pdf: ps2pdf (or ps2pdf14) -sPAPERSIZE=a4 inputfile.ps outputfile.pdf
具体的paper size定义看一看文档吧.man ps2pdf
h*********2
发帖数: 192
12
set output OUTPUTFILE
plot INPUTFILE u 1:COL ps 0 lw 3 lc rgb "red" ti "M",
INPUTFILE2 u 1:COL ps 0 lw 3 lc rgb "purple" ti "L^{+}",
INPUTFILE3 u 1:COL ps 0 lw 3 lc rgb "blue" ti "P"
请问这个第三行 的符号 "L^{+}" 为啥出不来呢?
问下,谢谢~
A**u
发帖数: 2087
13
tell him ya......
awk 'NR>line#1 && NR outputfile
I suppose you want to print contents between line#1 to line#2.
r*****s
发帖数: 985
14
来自主题: Unix版 - a beginner's question
with enscript:
% enscript -a odd(or even) -o outputfile.ps inputfile.name
i********e
发帖数: 16
15

Use copy file1+file2+file3+... outputfile
D*******a
发帖数: 207
16
来自主题: Statistics版 - how to remove "tab markers" from a txt file?
最简单的是用tr;置换成空格:
tr "\t" " " inputfile > outputfile
(共0页)