Programming :: Accessing File And Manipulating With With Folders?

Mar 12, 2010

I have a .csv file with a list of Drugs Name that i need to remove from the folder. The folder consist of files that stored as drugname.mol format.

What i need to do is to sieve out those mol files from the folder?

How do i

(1) access the drugs names from the .csv file line by line (variable x)

(2) how do i access the files in the folder one by one (variable y)

(3) how can i do a comparison whether $x.mol == $y

(4) and shift them to another folder if $x.mol == $y

View 11 Replies


ADVERTISEMENT

Programming :: Manipulating A Date In A Perl Bash Script?

Mar 11, 2010

I've recently inherited a bunch of files at a new job and am trying to figure out some of the problems that have constantly popped up. The one i'm getting a huge headache with results from a bash script that is supposed to change a date format from a client populated txt field to one we want defined a certain way. Everything in the script works fine, except that one function. Below is the line i'm trying to manipulate, with date examples.

sed -e 's/.0000 EA/ EA/' -e 's/ 01012010 / 01-JAN-2010 /' -e 's/ 12312011 / 31-DEC-2011 /'

The one caveat is that the first date is non-static and changes daily. It is, however, always the current date. If it helps, the second date will always be a year away from the first date.My idea was to pull the current date via perl's DATE function, but...how to do it, and calculate a year away without throwing the rest of the bash script off? Any help would be appreciated. I'm sure it's a simple solution but i know absolutely nothing about these scripts and how they were written.

View 10 Replies View Related

Programming :: File Access Alert \ Only Gives The Processes Accessing The File At That Particular Moment?

Jul 11, 2011

I am trying to check what all processes are accessing a particular file (a UDP socket in my case) on a filesystem.I am using 'fuser' for that.But, it seems, it only gives the processes accessing the file at that particular moment.Is there any way to continuously run 'fuser' (or some other command) which will give all processes accessing the file during its run?OR is it possible to generate a filesystem alert when a particular process accesses the file?

View 1 Replies View Related

General :: Grep - Manipulating Large Text File Full Of Records

Nov 26, 2010

I'm trying to manipulate a large text file full of records (metadata - one complete record per line). I need to delete every line on which certain words appear - there are five different words, all pretty simple all-caps strings with occasional whitespace. I tried using grep -v, which worked a treat, but only string-by-string. Ideally I'd like to run this as grep -v -f, where the file targeted by the -f contains the strings I need to match in order to delete the lines they're in.

i.e. grep -v -f filecontainingSTRINGS.txt targetfile.txt > outputfile.txt

When I try this, however, I don't get any matches - or more specifically, no changes are made in the output file. It works fine if there's only one string in filecontainingSTRINGS, but it doesn't work if there's more than one (I'm using newline as the delimiter). (Also my machine doesn't recognise /usr/xpg4/bin/grep - no idea what that's all about!)

View 5 Replies View Related

Programming :: CSH Permission Denied When Accessing Local File

Mar 9, 2011

I've just recently started learning shell scripting and I've been working on a basic csh script, but I've been having a few problems. Here's the script

Code:
#!/bin/csh
echo Enter a file name
$< = FILE ##Name of file
echo enter a size (in kilobytes) to monitor
SIZETOMON = $< ##Size value that's input by user
du -k $FILE = $SIZE ##Size of the file that the user wishes to monitor
while (1)
if $SIZE > $SIZETOMON then
echo ALERT: File size is greater than $SIZETOMON
end

And here's the output
Code:
/home/lucer/foo.txt: Permission denied.
Badly placed ()'s.

I'm not really sure what the issue is with the "badly placed ()'s" or why it won't let me access files that I can access with the same shell when it's not in a script.

View 14 Replies View Related

Ubuntu :: Accessing Folders In 10.10 Netbook?

Nov 27, 2010

Where exactly can i find the filesystem of netbook? the left panel contains a files and folders icon which only shows me recent documents... also how do i access my windows and files on other hard disk driveS?

View 5 Replies View Related

General :: Accessing Files And Folders On LAN?

Nov 18, 2010

how to access files and folders on alive computers on my college LAN,i hv angry ip scanner installed but it only lists the computers on lan,whereas i want to access files(e.g copying,etc) on others computers(in the same way we do in advance ip scanner in windows). i am using ubuntu 10.04 LTS

View 1 Replies View Related

General :: Sharing - Check Who Is Accessing Shared Folders?

Feb 11, 2011

Is there any utility that shows, who is accessing( has accessed ) my shared folders. I am using samba to share folders with other windows machines.

View 2 Replies View Related

Ubuntu :: Accessing Permission Locked Folders Through Livecd?

Dec 6, 2010

My spare laptop refuses to load into the OS (it's running 10.10) or even give me a log-in screen - it sits there with a blinking cursor in the corner of a black screen. It's a 7 year-old laptop I mainly use as a mediacenter, which means I keep very little on it so I figured I'd just do a complete reinstall and move on.

So I threw in a livecd to grab the one folder I needed before I was going to wipe the drive, but apparently at some point this folder got permission locked, and it won't let me open it or copy it to an external through the livecd. Is there any way I can get at this folder?

View 1 Replies View Related

Software :: Accessing IMAP Folders Using Mutt With Lavabit?

Jul 1, 2010

I'm having some issues accessing any folders besides INBOX on the lavabit IMAP server using mutt. I'm not sure if it's something I'm doing wrong specifically or if lavabit just has some funky folder setup and I don't know how to use it. here's the basic server info, though I don't think that'll do much good for my issue (more specifically: I can log in, send messages and read my inbox, but not use other folders).

Here's my .muttrc:

Code:
#####.muttrc#####
set realname= '<REAL NAME>'
set from= <USER>
set imap_user= [user]@lavabit.com

[Code].....

View 1 Replies View Related

Ubuntu Security :: Accessing NTFS-encrypted Files And Folders?

May 14, 2010

After trying Truecrypt, LUKS, and Ecryptfs I decided to try NTFS encryption. Now, on a dual boot computer from Ubuntu I can browse the encrypted folders but can not open the encrypted files. All attempts produce access denials yet the Unix file permissions appear to be "0777" (owner, group, and world readable-writable).

Is there someway to get Ubuntu's NTFS software to recognize and decrypt the encrypted files? Would a different NTFS package work such as NTFS-3g?

View 2 Replies View Related

Ubuntu Networking :: Accessing Windows Network Share Folders

Feb 16, 2011

I'm using Ubuntu 10.10 since 2-3 weeks. First I tried live CD and the OS seems to be very good. So i installed it on my laptop.So far i had no problems until I tried to access the shared network folders of my Server running on MS Windows Vista and another trial PC running WindowsXP. I'm trying to solve this since 2-3 days, I haven't found a solution.1st of all my network works fine. All computers can ping each other and as the laptop had Windows XP installed the server was accessable.1st I installed the SMB4k tool with this program. I could see the computer names, but as soon as I select a Windows computer the tool searches and nothing happens.

I tried a lot of different variations of this command but in the end I receive this kind of error. I also tried to add -o user=username pass=password, nothing changed.After this I searched information about this error, some forum threads I googled are telling the SMB4K tool modifies the /etc/sudoers file and cause this error. So i tried to change it back with some kind of sudo chmod 0640 etc/sudoers but this won't work it seems I can not modify or edit thisw file using sudo.With the pyNeighbourhood tool I could only see my Laptop but not the Windows PCs.At the end I will install Linux systems on all of my PCs, but only if all my tests will pass .

View 1 Replies View Related

Debian :: Deny The Users 2 & 3 From Accessing Windows Driver And Folders?

Oct 30, 2010

as we know in windows xp drive and folder permissions, we perform (folder-right click-properties-security tab-we check, group or user and assign ALLOW or DENY access to the folders) In the same way i want to DENY access to my windows driver sda1 & sda2 from the Debian OS. my system is being used by 3 users: user1, user2 & user3. All can access to all Volumes, so I want to Deny the users 2 & 3 from accessing my windows driver and folders. BUT i alone user 1 should have permission to access them. How do i change that in Debian 5.5? Allow/Deny Permissions to Volumes.

View 3 Replies View Related

Programming :: Detecting Newly Created Folders / Files On Local File System?

Apr 16, 2010

Using C++, I want to process sub-folders on my home folder sequentially each with a special naming format and containing some binary files in it:

Code:
1/
2/
3/
4/
5/
6/
...

Give above folders, I will process files in 1/ at first, 2/ at second, 3/ at third, and so on.

For some n/ folder, if I realize that n/ actually does not exist in local file system, I do not want to wait for it. Hence I will keep processing (n+1)/ folder, and so on.

However, when processing some (n+m)/ folder, previously not processed n/ folder may have been created on local file system. In this case, I do not want to miss processing it, but somehow detect its creation and process it. After processing n/ folder, I want to continue from (n+m+1)/.

View 5 Replies View Related

Ubuntu :: Manipulating Data From Ntfs Filestream?

Jun 8, 2010

an operator saved a file with a ':' in it, creating a file stream (new concept to me). I'm wondering if anyone with wisdom can point me to know how to get the data from that file piped into another file.. i.e. he saved as "wrong file: rest of wrong file title.wmv"

so first, can this be salvaged in ubuntu? ..how? ..

I figure I'd need the orig. hdd, maybe..:

Code:
cat "wrong file: rest of wrong file title.wmv" | cat > rightFile.wmv

dunno.. Am I grasping, or am I on right track?

this is for work, so I'm not at liberty to tinker & possibly mess it up more than it is.. the encoder's log also lists ":$DATA" after the rest of the file after the colon

View 2 Replies View Related

General :: Manipulating Fonts From The Command Line?

Jul 30, 2010

I would like to manipulate font size of a text file, preferably from command line, before printing it.. Any Linux tool you can suggest?

View 1 Replies View Related

CentOS 5 :: Manipulating .ps/.pdf Files; Doubling Up On Pages?

Dec 19, 2009

I'd like to take a regular .pdf file (also converted it to .ps), and double the pages and switch it to landscape orientation. I've used the tools at the following website, but it doesn't exactly do what I want it to.[URL]... In particular, the left page is too far to the left, and both pages are too high up. Please see attached screenshot of one of the pages. I'd like to get this to work because then instead of printing 234-page coursenotes, it'll be half that. Does anyone have a good solution to do this?

View 5 Replies View Related

Software :: Manipulating Fixed-column Records In Bash?

Jul 20, 2011

I have a performance report that provides all the information I need to report the following: total transactions per day, average transactions per second, and peak transactions per second. It just doesn't provide any of it in a very accessible manner, so I want to parse on it and just capture the bits I care about. Ideally, I'd like the output to look something like this:

Code:
Date Total Avg Peak
07/11/11 12,328,033 24.05 64
07/12/11 9,328,429 21.98 56

The problem is the format of the input file, which is somewhat complicated. The report gives a summary of all transactions within any given second, and then totals at the end of each day, with page breaks in the middle, like so:

[Code]...

So first, the easy part that takes me to the daily summary, which gives me the date, the total transactions, and I can divide the total by 86400 to get the average per second, too. No problem. It's the last part that's got me stumped... the daily peak. I can't just do a while loop on the date, because it's missing from most of the records. And it also means I can't use positional parameters, because depending on the page break, the total will move between $2 or $3. And I need the date as a conditional to find the daily peak, because this output will have many days' worth of data.

Any ideas? Some kind of awk or sed command to insert the date wherever it's missing (I'm not particularly good at either utility)? Is there a method to parse these things based on column location that I'm not aware of?

View 12 Replies View Related

General :: How Many File Descriptors Accessing A Given File

Nov 28, 2010

On linux, is there a way to count the number of file descriptors open to a some file?

View 1 Replies View Related

Programming :: Accessing C Function From C++

Jul 5, 2010

i have an open source application that was developed in C++ (it uses objects and namespaces all over the place). I also have another application that was developed in C. Now i am trying to insert the code made in C into C++ application, but when i do that , i get this error on compilation of the source code:

Code:
error: 'mpi_init_vars' was not declared in this scope the function mpi_init_vars() is not part of object oriented programming and it doesn't belong to any scope, it was compiled into an object file and i am linking it with all objects of C++ application.

How can invoke the C function from C++ object oriented code?

View 2 Replies View Related

Programming :: Accessing Python Scripts Using Web?

Mar 17, 2011

I am using Centos. I have written some scipts in python that access my routers and fetch the configuration, etc. Now i was thinking of creating a web interface which i can access from my windows XP. I want it to have good look n feel :-),

View 7 Replies View Related

Programming :: PHP Accessing Variables Within Array

Mar 30, 2011

I am pretty new to PHP so excuse my dumbness. I've searched this up in quite a few places and cant find anything : Basically, I've made an array, within it are 3 more arrays. Their are two values in each array, 'Name' and 'Age'. Basically I am using a While statement to try and cycle through the 'age' value of my array and state whether or not the person is eligible. (I am actually just learning so I'm doing this to just test myself).

Here is my code
Code:
<?php
$people =array(
array('name' => 'Bob', 'age' => 15 ),
array('name' => 'Jhon' , 'age' => 10),
array('name' => 'Sue' , 'age' => 7));
//($value =& $people[0,1,2][age] );

Here was an attempt to try and create a reference to age, I tried it many different ways
while($age < 10) {
echo ('$name, is eligible') ; } ?>

Okay, so I tried to do this through two ways, one way I tried to create a reference to age, then evaluate it, without that line of code their would be no reference, which way is correct, why wont it work? I am using Xammp, so when I launch local host I get an undefined variable error. What To Do?

View 3 Replies View Related

General :: Find Folders With ONLY One Specific File In And Delete File And Folde

Oct 21, 2009

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 Related

Programming :: Accessing A Sybase Database From PHP Running?

May 12, 2011

i get some trouble setting up good environment in linux.i have problem regarding connecting php(under linux) to a sybase server(under windows)is there anyway connecting this two technologies?.

View 1 Replies View Related

Programming :: Accessing Server From Remote Host?

Mar 2, 2011

i have made a java web server which works on localhost.but now i want to capable it handling many clients at a time.so clients running on different computer need machine name or IP address of server computer.How can i do this in java?

View 1 Replies View Related

Programming :: Accessing Global Variables In Script?

Apr 10, 2011

I have a script that goes like this

step 1 - install sdk

step 2 - update ~/.bashrc export some new variables

step 3 - check said variables, if they return a value then we know a reboot has taken place and we can continue to step 4. otherwise halt and isssue a warning that a reboot is needed.

Ok, so this works if I just execute the script when I am logged on as root, and after a reboot & rerun of the script I can check the variables exist and the program will continue as expected. only when I am logged on as root will the variables I exported in bashrc return a value. If I run the script as sudo root the values are blank.

View 2 Replies View Related

Programming :: Getting Error While Accessing Inode Structure Member / Why Is This?

Dec 16, 2010

I have added new member "i_mymember" to inode on-disk structure in ext3_fs.h file and tried to access this in userspace program, but gives me error that "error: �struct ext3_inode� has no member named �i_mymember� "

I have compiled my kernel source code.

why this error is coming ...?

View 1 Replies View Related

General :: Accessing MS SQL Server 2005 Standards With C Programming?

Oct 14, 2010

If you would share the different options to access MS SQL 2005 using C? We are using gcc compiler.

View 2 Replies View Related

Programming :: Other Stuff Accessing Data From Inside Gmail?

Jan 10, 2011

I started using Ubuntu's chat tool the other day, I gave it my Gmail username and password,and lo! it found my list of CONTACTS FROM INSIDE GMAIL!Facebook has done the same thing as well! Was this in Google's terms? Can't something be done about this? This is SCARY.But also, a small part of me wants to know how it was done (only a small part, this protocol sh*t is not particularly challenging, right?

View 14 Replies View Related

General :: Accessing .dd File Extension

Mar 2, 2010

I am trying to access a .dd file extension. Do I have to mount it?

VMware-VMvisor-big-3.5.0_Update_2-110271.i386.dd
# fdisk -ul VMware-VMvisor-big-3.5.0_Update_2-110271.i386.dd
Blocks Id System
VMware-VMvisor-big-3.5.0_Update_2-110271.i386.dd1 8192 1535999 763904 5 Extended
VMware-VMvisor-big-3.5.0_Update_2-110271.i386.dd4 * 32 8191 4080 4 FAT16 <32M
VMware-VMvisor-big-3.5.0_Update_2-110271.i386.dd5 8224 106495 49136 6 FAT16

[Code].....

I am trying to grab some files off this file to create a PXE vmware boot.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved