General :: Find EOF Char In File?
Dec 10, 2010How to find EOF char in file
View 1 RepliesHow to find EOF char in file
View 1 RepliesI've never programed shell scripting.
Code goes like so:
I simply want to read a file "data.txt" line by line Then char by char and add them into a result var. The file is supossed to always contain numeric values
m getting the following error when trying to compile:Quote:
$ make
g++ -march=athlon64 -O2 -pipe -fomit-frame-pointer -msse3 -c -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"undelete"' -DHAVE_SVDRP -I../../../include undelete.c
[code]...
Programming in C.I have two char arrays.char buf1[1024];char buf2[1024];Aren't buf1 and buf2 also pointers?I read in 1024 bytes into buf1 which contain about 300 bytes of characters with newlines. The data is basically a few English sentences. I'm trying to scan buf1 for newlines and then stop at the 1st newline and copy the rest of the data from that 1st newline into buf2.So I run a for loop to look for that new line.
Code:
for(i=0; i<1024;i++) {
if((strcmp(&buf1[i], "
[code]...
I am having trouble with the following exception class.
Code:
/**Standard Exception
*
*@description
*@update
*@changes
[code]....
Line 43 points at the snprintf() command.I think the error has to do with the function being virtual and the const after the function definition, however although I have been looking really hard I have not being able to find the reason nor the solution to the problem.
One workaround that I know is moving the block of source withing the virtual function, in the constructor, however having read around (boost library exceptions tutorials) it specifically said that formating of errors messages should not take place withing the construction of objects because we are risking throwing an exceptions and messing up the flow order.
i define variable of type char (range -128 to 127). when i tried to print the value after assigning a -ve value to it it displaying a +ve value of that -ve value(256+value).
View 3 Replies View RelatedWith this I may remove the last emtpy char which is not visible, coming from net, windows, ...
Code:
echo "$mystringwindowsorotherwithemptylastchar" |sed s/.$//
However if there are not then it makes a problem and delete effectively an existing char.
Code:
echo "klklj" |sed s/.$//
klkl
Anyone would have a solution for SH?
is it possible to convert a variable from char * to unsigned char ?
View 5 Replies View RelatedHow to remove alternate char from file using shell script? If the file content is "1234567890" the output file should be "24680".
sed 's/(.)(.)/2/g' filename
Now there may be small modification to generate two alternate byte, what it should be? If the file content is "1234567890" the output file should be "125689".
Greetings, I have installed a VMware host on Windows 7 64bit and followed with a 10.04LTS 64 bit guest install. Everything went smooth. I have used VMware before, but the other way around.. Linux host and Windows guest.
So this time I am installing the VMWare tools on the guest, ubuntu 10.04, but it seems to be failing. The vmware tools install ran fine the first time with no errors, but I was getting the follwoing error after logging into the Ubuntu guest afterwards.
Could Not Apply the Start Configuration for Monitors
Error Line 1: Char 1 Whitespace or empty file
So I re installed the VMware tools once again, but still the same.
I am hoping that someone here has come across this before and hs a workaround. I don't think the vmware tools was installed correctly.
Here is the issue. I am reading in a outside text file and putting in the string on that line into a char array that is already allocated.
Code:
int main(int argc, char *argv[])
{
[code]....
am new to linux and trying to find a file in sub directories using find command as:find .-name *.jpg -type fBut I am unable to get the result as find command is not permitted by the server administrator.Is there any way to find files without using find command.
View 14 Replies View Relatedthe query is ||| how to append a char | string |||
#!/bin/bash
echo -n "one""two""three"
#END
above method is working well but below method is not working ?
#!/bin/bash
one=one
two=two
three=three
echo -n $one$two$three
#END
Many folders within a subdirectory some of which have lots of data in and some of which have only one specific file called produkt.fil inside.I need a command to find and delete those folders that contain ONLY the file produkt.fil - if other files exist (doesnt matter what they are) then they should be left alone. Note: produkt.fil exists in all of the folders always.
View 5 Replies View RelatedI want to call a application file in user space through a character driver running in kernel space.
View 1 Replies View RelatedI am trying the execute the following
#!/usr/bin/python
import os
os.system("sed -e 's#^(.*) (.*)0http://12#' t2.txt > t3.txt")
os.system("cat t3.txt | sort | uniq -c | sort -rn | head > t4.txt")
But I receive the following error message.
sed: -e expression #1, char 27: unterminated `s' command
i have problem executing lex program though the code is correct i'm getting some errors and the error says: In function yylex:
error: invalid operands to binary | (have char * and char *)
error: invalid operands to binary | (have char * and char *)
error: expected ; before { token
i'm just curious if i can search for the dir/file pattern in the single "find" command?
here is an example:
dir1/dir2/dir3/file.txt
dirXX/dirYY/dir2/dir3/file.txt
dir1/dir4/dir3/file.txt
i want to search for the pattern "dir2/dir3/file.txt"
Just in case someone can reply a silly question, I've quite forgot the vi/vim command to bring the cursor to the 1st char in the current line. I do remember that for bringing it to EOL is '$'.
View 14 Replies View RelatedI wanted to know how to find the end tag in shell where I have multiple tags in xml like
<tag name="x" version="1.0">
</tag>
<tag name="x" version="1.0">
[code]...
in directory so many files are there. if we want to find some text in all the files, what is command is to be used.
View 6 Replies View RelatedIs there a way to take a "char*" string in C and turn it into a "FILE*" stream?I tried searching, but all the answers I get are about C++.
View 2 Replies View RelatedI have just downloaded, configure'd, make'd and make install'ed the Google Log Library to my computer. It built all required files (as far as I can see) and copied the .so file (libglog.so.0.0.0) to /usr/local/lib. Then it created two symbolic links called "libglog.so.0" and "libglog.so" that point to that shared object file:
lrwxrwxrwx 1 16 /usr/local/lib/libglog.so -> libglog.so.0.0.0
lrwxrwxrwx 1 16 /usr/local/lib/libglog.so.0 -> libglog.so.0.0.0
-rwxr-xr-x 1 498381 /usr/local/lib/libglog.so.0.0.0
Now I'm trying to execute a program that uses the library, but when I start it, I get the error message that it can't open the so-file:
cloud:/home/blam/redirector/redirector2# ./redirector ./redirector: error while loading shared libraries: libglog.so.0: cannot open shared object file: No such file or directory
/usr/local/lib is included in my /etc/ld.so.conf file, and another library that's located in this directory is loaded correctly.
How to find file by content on linux by command. Example: i want find file contain word "helo" on my computer (OS: LINUX)
View 4 Replies View RelatedI am trying to find and delete a file using this Code: find . -type f -name ph2964781400100954291.jpg -exec rm -f {} ; It does not work, I think because by default on my distro rm is iterative.
View 2 Replies View RelatedCan we find the inode of a particular file using its inode number?
The reason is i want to know how many blocks are occupied by specific file.
if we consider block size of 1K.
if the file size is of 100 bytes. In such a case, when the file is
stored on disk, the file will occupy 100 bytes or 1K (since we have
choosen block size to be 1K) ?
send me the code to find the md5 checksum of a file in c++.
View 7 Replies View Relatedi want to write a program that need to know how much data has transmitted in network usage _how much send and how much received_which file , record or structure in which library i have to follow ?
View 2 Replies View RelatedIs there any way to know which process had created any file in Linux Red Hat/CentOS 5?
View 2 Replies View RelatedI'm using bash under Ubuntu.Currently this works well for the current directory:catdoc *.doc | grep "specificword" But I have lots of subdirectories with .doc files.How can I search for, let's say, "specificword" recursively?
View 2 Replies View Related