Programming :: Scan In A File Which Has The Format?
Apr 3, 2011
I am trying to scan in a file which has the format of
Quote:
username:password
hello:world
right now my program says
Code:
Scanner fin = null;
try
{
fin = new Scanner(new FileReader("proj1/passwd.txt"));
[Code]...
How do i correctly use delimiter to take in only the strings on one line?
View 1 Replies
ADVERTISEMENT
Jul 16, 2010
Something very handy to do in a Linux shell, is manipulating files and strings - essentially parsing data. Write a utility which will scan in a text file and search and replace strings. We also want to keep track of how many strings we've replaced.
I know that my command would look like this: <utility name> <filename> <stringToSearchFor> <stringToReplaceWith>
Code: #!/bin/bash
[code]....
View 2 Replies
View Related
Dec 16, 2010
I made a string key-value mapping struct in C, and functions to add and remove entries. I would also like to write a function to read in this file format:
Code:
key: value
another: another value
[code]...
View 14 Replies
View Related
Mar 24, 2010
I want to change data format in a file using bash. The orignal is like:
Code:
1 abc 6 pqr
2 def 7 stu
3 ghij 8 vwx
4 kl 9 yz
[Code]....
View 9 Replies
View Related
May 10, 2010
I am trying to have GNU assembler produce object file COFF format? I did not find relevant information from GNU assembler's manual.
View 1 Replies
View Related
Feb 3, 2010
I am using C. I have a fuction that returns a string
Code:
I need to format this string so that I can create a text file like so:
So I'm trying:
Code:
But I get errors like:
View 2 Replies
View Related
Feb 19, 2011
I was wondering, what would be a good, open-source file format for a beginner in the field, like me, to start editing sound files? This file format would have to be well documented, preferibly open-source, lossless and, most of all, convertible to more popular file formats, such as mp3 or wav maybe. I would like to design my own sound effects through directly editing the binary sequence of a sound file. I imagine this editing would have the purpose of adjusting the voltage variations of the sound device's output in time. It would be perhaps something like a PC-controlled signal generator. I'm thinking I might be able to do this in linux with something like
Code:
$ dd if=mysound.raw of=/dev/audio
But then, which book or resource woule be a good and through explenation of the relationship between the bit sequence in mysound.raw and the signal function generated in the output of, say, my computer's sound card.
View 10 Replies
View Related
Apr 22, 2010
I am trying to compile a software using a provided sdk. I suspect that the sdk has some mismatch of the platform library, but I am not sure.
The error I got is
Code:
The libidata.so.42 is there in that folder. I guess the file might be in a big endian. Is there a way to check if the libidata.so.42 i have might be a big endian format, rather than little endian?
If my guess is incorrect, This is a c++ code on fedora x86 machine.
View 4 Replies
View Related
Apr 7, 2010
my school we want to print a magazine but we have problem with the format of the files. We need to create a sheet in A3 format from two sheets in A4 format. I was reading about the pdftk library but it doesn't do what i need.
View 4 Replies
View Related
Jan 9, 2011
I installed squeeze on my eeepc 1015ped and downloaded the correct firmware-brcm80211 drivers but every time I scan for my network using iwconfig wlan0 scan or wicd, my computer completely freezes. I previously had a solid install running xmonad, and wicd was working like a charm (using the same broadcom driver) but i tinkered too much with it and decided to do a fresh install. I haven't quite run into a problem like this before.
View 2 Replies
View Related
Mar 28, 2011
I am running a scan via nmap (nmap -sP) and the out put looks similar to this:
Nmap scan report for x.y.z.com (10.x.x.x)
Nmap scan report for 10.x.x.x
If it can resolve the hostname it does, if not it just spits out the IP. I would like to know the best syntax to use with cut, or awk, so that the only output is either the IP or IP - HOSTNAME.
View 3 Replies
View Related
Dec 15, 2010
I see the documentation of CLAMAV in[URL].. The example for scan mail with pishing url is
Quote: clamscan -i /home/user | mail user@example.com
and also
Quote:
clamscan file
for scan a file
But how to SCAN a file have only inside a list of URL for get the url's inside the file have any malware, pishing or virus
View 1 Replies
View Related
Feb 10, 2011
Neither my Simple Scan nor the Xsane image scan facility appears to be able to scan a typed document to editable text. Is there software available to enable this facility on Ubuntu 10.10 using my HP Officejet 6313?
View 7 Replies
View Related
May 18, 2010
Whenever I open a folder with the default browser (Nautilus), it does a quick scan of the contents. This is not a problem for normal folders, but it becomes one when a music folder contains several thousand files (I haven't yet tried with folders containing large amounts of non-music files). In such instances Nautilus sits there scanning and I can hear the hard drive seeking for a good while before it presents me with the contents of said folder. My music folder, for instance, contains some five thousand ogg files, and I have to wait *counts* a full minute before it displays its contents. I tried telling it to never count the number of files in the options, but it didn't help. So far, the only solution I've found is to use pcmanfm instead, which apparently does no scan and displays my music folder practically as soon as I click on it. Still, I like Nautilus more for everything else, so I'd much rather use that instead.
View 6 Replies
View Related
Apr 26, 2010
Fedora12/Kde4After a Sane Scan how do I Save a scan as a *.txt file ? gocr does not work, I can save in any other format but a txt file.
View 6 Replies
View Related
Aug 13, 2010
I decided to check out nautilus-clamscan, in which all it does is add an option to scan the selected file or folder for viruses in the context menu, and while it works fine for some things highlighted, for some that I've randomly tried it freezes, and won't complete scanning. using the usual method of scanning for viruses through Clamtk, it scans those files and folders just fine, so it's not those themselves that's causing the freezing.
View 8 Replies
View Related
Sep 1, 2010
I have a file which contains the data i retrieved through prstat and an array that contains all the unique process ID's of that particular file. i want to compare each and every line in the file with each and every element of the array so that i can create multiple files for the multiple value in the array.
View 6 Replies
View Related
Apr 5, 2010
In /etc/fstab, I have a record:LABEL=/< >/< >ext3< >default,nolog< >1 1 represent a tab between 2 fieldsI just want to remove "nolog" in the 4th field (only): gsub(/nolog/,"",$4)The function work ok but it returns a record:LABEL=/ / ext3 default 1 1I know the problem is OFS=" ", but how can I keep the format of the record? (the same number of tabs, spaces).
View 5 Replies
View Related
Sep 10, 2010
I'm looking for some expert opinion on sed/script to work out the best way to transform one xml format into another however there are a few complexities around translation.
The extra complexities are to:
1) Take the start and stop time (YYYYMMDDHHMMSS) and convert to start time to unix time plus output the difference in seconds between both times.
2) Oid, tsid and sid are found by looking up an external file and finding the value against the channel. For example one of the lines in the file will be 2:806:27e2=channel1
Is there any way to write piped sed commands that can do this? If not, any ideas how the script should look like?
Input File
Code:
<programme start="20100910060000 +0100" stop="20100910061000 +0100" channel="channel1">
<title lang="en">This is the title</title>
<desc>This is the description</desc>
</programme>
Output File
Code:
<service oid="0002" tsid="0806" sid="27e2">
<event id="0">
<name lang="OFF" string="This is the title"/>
<text lang="OFF" string="This is the description"/>
<time start_time="1284098400" duration="600"/>
</event>
</service>
Look up file for oid, tsid and sid
Code:
2:806:27e2=channel1
2:756:37a3=channel2
5:4a06:42e5=channel3
View 8 Replies
View Related
Feb 16, 2011
In C++ as subjected, can anyone throw me some light on how I can generic-ly format an integer value of 1 to a string value of 0001? 11 to 0011? and 111 to 0111? simply by just appending 0 in front and limiting the length of the string to 4?
View 4 Replies
View Related
Sep 21, 2009
I have a series of files in the format:
Which I'm trying to split using sed to have each field/value pair on on line:
So far so simple, but some of the values might have commas in them, which means they'll be split up. Is there a way to change this so that only commas not within quotes will be replaced with ? (e.g. make sed count number of " and if it finds a , after counting an odd number of " then ignore it?)
View 2 Replies
View Related
Feb 16, 2011
What is the problem? I receive this message (see in red) when i running this script (below) on bash script file:
error received:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 70 0 70 0 0 321 0 --:--:-- --:--:-- --:--:-- 0
IMAG_DOS.ZIP
[code]....
View 1 Replies
View Related
Feb 22, 2010
language: cOs: ubuntu 9.10 want a c or c++ program that gives the system uptime in YYYY: MM: DD HH : MM: SS format.eally it is head ditching..This is not home work or assisgnment..
View 10 Replies
View Related
Jun 5, 2011
I'm reading a book on assembly, and it talks a bit about the IEEE floating point format.
Quote:
To summarize, the following steps are used to convert a decimal number to IEEE single format: 1. The leading bit of the floating point format is 0 for a positive number and 1 for a negative number. 2. Write the unsigned number in binary. 3. Write the binary number in binary scientific notation f23.f22 ... f0 2^e, where f23 = 1. There are 24 fraction bits, but it is not necessary to write trailing 0's. 4. Add a bias of 127 to the exponent e. This sum, in binary form, is the next 8 bits of the answer, following the sign bit. (Adding a bias is an alternative to storing the exponent as a signed number.) 5. The fraction bits f22f21 ... f0 form the last 23 bits of the floating point number. The leading bit f23 (which is always 1) is dropped.
View 1 Replies
View Related
Mar 27, 2010
I was installing DYMOUM from [url]. "make" command is issuing this error:
Code:
Prior to this, ns-2.34 was working fine. Patches are applied very well.
I am in under fedora 9 and:
Code:
View 9 Replies
View Related
Feb 22, 2010
Request help with scanjet 3500c operation. xSane .996 in Ubuntu sees scanjet and scans. As soon as scan completes, the xSane windows(2) disappears and there are no copies in the intended save folder in Documents. Upon original attempt, the xsane windows had an additional third "Preview" window which has not returned since that first scan attempt?
One is not a computer guru by any imagination!
Info; the scanjet worked very well on the other "doze OS" and seems now, does not in the Ubuntu OS. In Doze, there was also a program for a HP PhotoSmart 3200 running and when I added the scanjet it might have been happy with that driver. Currently I do not have access to the driver disc for the 3200 with me. Too, it now takes ~45+ seconds for the scanjet to begin as compared to 2 - 3 seconds on doze.
Some internet self help searching seems to suggest the xSane 1.0.18 is the driver choice to use with the HP 3500c scanjet. When attempting to download, an archive "Failed" notice appears. I am a bit lost from here.
View 1 Replies
View Related
Jun 16, 2010
I am having a desktop motherboard of D31 model. In this i tried to load the RHEL4.2 but the required ahci driver is not there. So if anyone could specify me like whichfile-format file to be used while installing Linux OS, using the option boot:linux dd.
View 9 Replies
View Related
Sep 9, 2010
I have a new external 500gb drive I want to format and put data on. I first formatted it as Fat32 as I'd like to access it with Windows at some point. I ended up having a few files over 4gb, so that didn't work.
I'd like to use UDF as the file format. Does anyone see any issues with formatting a 500GB drive with UDF? I don't see any reason why I would want to WRITE to the drive in Windows, just read...but there is software out there to allow Windows XP to write to a UDF drive if I needed to.
View 4 Replies
View Related
Apr 10, 2010
What is the realmode interrupt return on the stack. Is it pop AX pop CS or vice versa?
View 4 Replies
View Related
Feb 20, 2010
I have created a file using open() and written data to it. Data appears as normal characters in the file. How to save these characters in a binary format in that file using C language? Here I mean that the characters should be actually stored as 0 and 1. Do I have to convert the whole data using some function or there is some standard way to do it in Linux?
View 14 Replies
View Related