473,321 Members | 1,622 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

Split words and creating new files with different names

I need to write a program like this: Write a program that reads a file .picasa.ini and copies pictures in new files, whose names are the same as identification numbers of person on these pictures (eg. 8ff985a43603dbf8.jpg). If there are more person on the picture it makes more copies. If a person is on more pictures, later override earlier copies of pictures; if a person 8ff985a43603dbf8 may appear in more pictures, only one file with this name will exist. You must presume that we have a simple file .picasa.ini.

I have an .ini, that consists:

[img_8538.jpg] faces=rect64(4ac022d1820c8624),d5a2d2f6f0d7ccbc backuphash=46512

[img_8551.jpg] faces=rect64(acb64583d1eb84cb),2623af3d8cb8e040;re ct64(58bf441388df9592),d85d127e5c45cdc2 backuphash=8108 ...

Is this a good way to start this program?

Expand|Select|Wrap|Line Numbers
  1. for line in open('C:\Users\Admin\Desktop\podatki-picasa\.picasa.ini'):
  2.     if line.startswith('faces'):
  3.         line.split() # what must I do here to split the bolded words?
Is there a better way to do this? Remember the .jpg file must be created with a new name, so I think I should link the current .jpg file with the bolded one.
Nov 26 '10 #1
1 1485
dwblas
626 Expert 512MB
The start/stop characters are "(),;" and possibly a space but I can't really tell. You would probably have to parse the line one character at a time and "split" it yourself on those characters, keeping the groups that started with a left parens or a comma.
Nov 29 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Pjotr Wedersteers | last post by:
Hi, I am rather new to PHP and a relative newbie to Linux too. I have a webserver at home (Apache 2.0.48 on SuSe 9.0, PHP4). I have some scripts, one of them needs to be able to create logfiles...
2
by: Satish Kumar Chimakurthi | last post by:
Hi all, An external solver program is dynamically producing files with different names 0000001.dat, 0000002.dat, 0000003.dat etc.....at regular intervals. These files contain all numeric data....
9
by: monomaniac21 | last post by:
Hi everyone i'm trying to setup my website to create new webpages dynamically using php but I am have a major problem in that whenever i create a file it is always created locked so that it can...
0
by: gorbus | last post by:
Hi All, I'm using .NET remoting. It means I have to .config files - one for client, one for server. Is such configuration ok (note, that DLLs have different names) ?: SERVER: <configuration>...
11
by: Jovo Mirkovic | last post by:
I have a simple Form with a Button1 and TextBox1. When I click button, I want execute a Sub procedure with name TextBox1.Text... Is it possible? Thanks, Jovo
1
by: Anastasios Hatzis | last post by:
Hi, is it possible to have different names between the original package name and that which will be installed? Example: setup.py src/ sdk/
3
by: nickyeng | last post by:
i getting a line from text file, and then i have to split the line into words. i have this in my text file , "23 Nick male" i'm not sure how to split those words from a line in C language. ...
7
by: Soneji | last post by:
*sigh* Ok, I have two questions. First, my setup: Win-doze XP-SP2; & Dev-C++ 4.9.9.2; I recently started trying to use 'fstream' to work my input/output, and I noticed that using the...
6
by: likhin M | last post by:
Hi everyone, I am developing a webpage using only javascript.And I am dynamically creating buttons inside javascript as follows document.write('<button name=""...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.