Find the first paragraph of each specific chained text block...
Hi all
I have this kind of layout:
... with several groups of text blocks chained [red, green,...].
I want to find in the identity document all the first para of each text block defined by a "BLOCK of TEXT GREEN" object style and apply a paragraph style "GREEN PARA STYLE while FIRST THE block"! as:
Thank you much for the help!
Here is a new version:
main(); function main() { if (app.documents.length > 0) { var story, containers, container, doc = app.activeDocument, stories = doc.stories; try { app.findTextPreferences = app.changeTextPreferences = NothingEnum.NOTHING; app.findTextPreferences.appliedParagraphStyle = doc.paragraphStyles.item("GREEN PARA STYLE FIRST ON BLOCK"); app.changeTextPreferences.appliedParagraphStyle = doc.paragraphStyles.item("GREEN PARA STYLE"); doc.changeText(); app.findTextPreferences = app.changeTextPreferences = NothingEnum.NOTHING; } catch(err) { $.writeln(err.message + ", line: " + err.line); } for (var i = 0; i < stories.length; i++) { story = stories[i]; containers = story.textContainers; if (containers.length > 1) { // process only chained text blocks for (var j = 0; j < containers.length; j++) { container = containers[j]; if (container.appliedObjectStyle.name == "GREEN TEXT BLOCK") { try { // if the style or the 1st paragraph is missing, write error message to console and continue container.paragraphs[0].appliedParagraphStyle = doc.paragraphStyles.item("GREEN PARA STYLE FIRST ON BLOCK"); } catch(err) { $.writeln(err.message + ", line: " + err.line); } } } } } } else { alert("Please open a document and try again.", "Error", true); } }
Tags: InDesign
Similar Questions
-
Can I Auto format the first paragraph on each page of a document of 20 pages?
So, I have a document that is in fact just a numbered list of 200 entries.
There are 10 items per page, which makes it a 20 page document.
Unfortunately, from time to time I give myself an extra entry to add, whose invariaby is in the middle of the document and not at the end.
What I would do, if I add a new #20 to the document, the old #20 (now #21), pushed to the next page, would then automatically be formatted with the paragraph style to my 'Style'.
I could not find out how to do this, which means, in the above example, I need to go to 18 pages and remove the 'Style' formatted as in each case after the addition, it is now the second entry on the page. At the same time, I must apply the paragraph 'Style' formatting for each first entry of all subsequent pages. If I only had to do from time to time, it would not be a problem, but this document is regularly updated, it becomes tedious.
Nested styles does not seem to be an option, because I use the numbering that requires a paragraph break to differentiate each line number and nested styles seem to apply to each paragraph, except if I am doing something wrong here.
I hope that this is sufficient to go.
Sébastien
You say that the formatting is different for each paragraph 20, reagardless of its content, and it is going to be the first paragraph on a page to go?
As long as never depart you from the cycle 20 paragraph that it's actually pretty easy to do, just 20 paragraph styles, of which 19 are based on the other and differ only in the name of style. You then together "next" style attributes to run through the list of styles, then the following style for #20 is #1 and the sequence starts over. Now just select the entire block of text between the point where you have edited at the end and click right on the name of the TSRI in selecting paragraph style, then in the menu popup, choose apply
and following Style. -
Find the first row of each column
Hi all
Request:
I want to find the first line in the text frame columns.
Bug:
If the active document contains a single column, two columns, and multiple column text blocks. In this case, I'm not able to get my result
Try the script:
myDoc = app.activeDocument var
var myTextFrames = myDoc.textFrames.everyItem () .getElements)
for (i = 0; i < myTextFrames.length; i ++)
{
var myTextColumns1 = myTextFrames [i] .textColumns [1] .lines [0] .silence
Alert (myTextColumns1)
}
Attached, I have attached the error file.
If the active document contains only two block of text column, script executed successfully.
If the active document contains the single column text block and the sampling error two columns of text as below:
Could someone find solution for my application.
Thanks in advance
BEGINNER
Try this,
myDoc = app.activeDocument var
var myTextFrames = myDoc.textFrames.everyItem () .getElements)
for (i = 0; i
{
for (var j = 0; j)
{
var myTextColumns1 = myTextFrames [i] .textColumns [j] .lines [0] .silence
$.writeln (myTextColumns1)
}
}
-
make the first line of each paragraph "BOLD"
Hi all
I read this forum, but I can't really find the answer, I need.
Here's my problem, we intend to automate the flow of text in our Organization, that's what I have to do
-read the input from the story of a database
-flow text into a text box in particular for example 4.5 cm wide
-each paragraph will be had 2 new lines
-Select the first line of each paragraph then putting in bold.
in the above list, I can do everything except the first paragraph selection and putting in bold. I am looking for the selection of text I see there is a function called textframe.select?
Can someone help me with this please?
This severely reduced your options. (Which reminds me, you can specify a detail important like that from the beginning the next time.)
The simple solution would be to apply your "BOLD" font (or better: a character style) in the first line of each paragraph by using the property of a paragraph .lines. UH customary ‑‑ link to the HTML version of the omitted OMV, it seems I'm not coming back as much as CS2... (Is there a CHM for it to http://www.jongware.com/idjshelp.html).
This should work:
App.Selection [0] .paragraphs [0]. Lines [0] .appliedCharacterStyle = "YourBoldCharStyle";
... With your cursor in the paragraph you want to change. Will adjust to meet your specific needs.
There is a drawback of the simple method. Unless you use a special police who makes bold with the same width as her (quite rare) usually, the text will be redistributed after he applied. So there are one or more words in bold on the next line, so you must remove the tank style "BOLD" of those. But! At that time InDesign may determine that these non-bold words may go back on the first line!
Well written code does not help, because it could be possible the same word oscillates backwards with each change between the first and the second line, each time to cheat... At * some * point you'll have to help the poor ID a bit; perhaps to fix this first line with No Break applied.
-
How to find the first Sunday and the second Saturday of each month
Hi all
How to find the first Sunday and the second Saturday of each month
Thank you
Oracle Database 11 g Enterprise Edition Release 11.1.0.7.0 - 64 bit Production
994122 wrote:
Hello
I need to pass the months parameter how to do this? like Jan, Feb etc... (one of those)
Do you have a procedure?
Should you output only for the months you passed in the parameter?
The easiest way is to set the parameter as date. When you go such as p_date as DATE ' 2014-10-01', then you can
PROCEDURE two_dates)
p_date IN DATE
p_first_sunday DATE
p_second_saturday DATE
)
IS
BEGIN
p_first_sunday: = NEXT_DAY (TRUNC (p_date, 'MM') - 1, TO_CHAR (DATE ' 2014-10-12', 'DAY'));
p_second_saturday: = NEXT_DAY (TRUNC (p_date, 'MM') - 1, TO_CHAR (DATE ' 2014-10-11', 'DAY')) + 7;
END two_dates;
Or you describe what you need.
-
How to find the first max value for each item
Hello
I have the me_result of the table as below,
SELECT * FROM me_result;
ID ||| ELITE ||||||||||| FREQ_ITEM | COMBINED_STR | SUP
1 ||; 1; 10; 2; 3; 4; 5; 7; 8. 1 ||||||||||||||; 1; 10; 2; 3; 4; 5; 7; 8 ||| 2
2 ||; 1; 10; 2; 3; 4; 5; 7; 8. 2 ||||||||||||||; 1; 10; 2; 3; 4; 5; 7; 8 ||| 2
3 ||; 1; 10; 2; 3; 4; 5; 7; 8. 3 ||||||||||||||; 1; 10; 2; 3; 4; 5; 7; 8 ||| 2
4 ||; 1; 10; 2; 3; 4; 5; 7; 8. 4 ||||||||||||||; 1; 10; 2; 3; 4; 5; 7; 8 ||| 2
5 ||; 1; 10; 2; 3; 4; 5; 7; 8. 5 ||||||||||||||; 1; 10; 2; 3; 4; 5; 7; 8 ||| 2
6 ||; 10; 2; 3; 4; 5; 8; 9. 1 ||||||||||||||; 10; 2; 3; 4; 5; 8; 9; 1 ||| 1
7 ||; 10; 2; 3; 4; 5; 8; 9. 2 ||||||||||||||; 10; 2; 3; 4; 5; 8; 9 ||| 2
8 ||; 10; 2; 3; 4; 5; 8; 9. 3 ||||||||||||||; 10; 2; 3; 4; 5; 8; 9 ||| 2
9 ||; 10; 2; 3; 4; 5; 8; 9. 4 ||||||||||||||; 10; 2; 3; 4; 5; 8; 9 ||| 2
10 ||; 10; 2; 3; 4; 5; 8; 9. 5 ||||||||||||||; 10; 2; 3; 4; 5; 8; 9 ||| 2
I need to find the first COMBINED_STR max for each element of the ELITE,
I mean, max value is the max REGEXP_COUNT (combined_str,' ;')))
really, I try to write down, but I had a lot of values for each ELITE and I need only the first, that
SELECT * from me_result
WHERE (ELITE, REGEXP_COUNT (combined_str,' ;')))) IN
(SELECT ELITE, MAX (REGEXP_COUNT (combined_str,' ;'))))) ME_RESULT ELITE GROUP);
I need the result to be as below.
1; 1; 10; 2; 3; 4; 5; 7; 8-1; 1; 10; 2; 3; 4; 5; 7; : p
6; 10; 2; 3; 4; 5; 8; 9 1; 10; 2; 3; 4; 5; 8; 9; 1 1
any help please,.
Published by: user11309581 on July 10, 2011 22:03Can be
with t as (select 1 ID, ';1;10;2;3;4;5;7;8' ELITE, 1 FREQ_ITEM, ';1;10;2;3;4;5;7;8' COMBINED_STR, 2 SUP from dual union all select 2 ,';1;10;2;3;4;5;7;8' ,2 ,';1;10;2;3;4;5;7;8' ,2 from dual union all select 3 ,';1;10;2;3;4;5;7;8' ,3 ,';1;10;2;3;4;5;7;8' ,2 from dual union all select 4 ,';1;10;2;3;4;5;7;8' ,4 ,';1;10;2;3;4;5;7;8' ,2 from dual union all select 5 ,';1;10;2;3;4;5;7;8' ,5 ,';1;10;2;3;4;5;7;8' ,2 from dual union all select 6 ,';10;2;3;4;5;8;9' ,1 ,';10;2;3;4;5;8;9;1' ,1 from dual union all select 7 ,';10;2;3;4;5;8;9' ,2 ,';10;2;3;4;5;8;9' ,2 from dual union all select 8 ,';10;2;3;4;5;8;9' ,3 ,';10;2;3;4;5;8;9' ,2 from dual union all select 9 ,';10;2;3;4;5;8;9' ,4 ,';10;2;3;4;5;8;9' ,2 from dual union all select 10 ,';10;2;3;4;5;8;9' ,5 ,';10;2;3;4;5;8;9' ,2 from dual ) select ID,ELITE,FREQ_ITEM,COMBINED_STR,SUP from ( SELECT ID,ELITE,FREQ_ITEM,COMBINED_STR,SUP, ROW_NUMBER() over (PARTITION BY ELITE order by id) RN FROM t WHERE (ELITE,REGEXP_COUNT(combined_str,';')) IN (SELECT ELITE,MAX(REGEXP_COUNT(combined_str,';')) FROM t GROUP BY ELITE) ) where RN=1 order by id ID ELITE FREQ_ITEM COMBINED_STR SUP ---------------------- ----------------- ---------------------- ----------------- ---------------------- 1 ;1;10;2;3;4;5;7;8 1 ;1;10;2;3;4;5;7;8 2 6 ;10;2;3;4;5;8;9 1 ;10;2;3;4;5;8;9;1 1
-
Remove duplicates by selecting the first line of each subgroup in a Recordset
Oracle: 11 GR 2
Client Windows 7
I have a set of data (the result of a query) which is similar to:
D_rank product_id product_desc category income price cost
1 112233 prod1-iphone phone 200 500 100
1 112233 prod1-iphone4 phone 200 500 100
2 223344 prod2-300 1000 400 windows7 OS
2 223344 prod2-300 1000 400 software windows7
3 334455 prod3-Mac 1000 computer 1500-1000
4 445566 prod4-xyz 2000 800 1200 misc
: : : : : : :
: : : : : : :
: : : : : : :
As you can see the first 4 rows, these rows are repeated due to the product_desc and category material. I need these fields but the first value in each subgroup, so that each row is unique. I.e.
D_rank product_id product_desc category income price cost
1 112233 prod1-iphone phone 200 500 100
2 223344 prod2-300 1000 400 windows7 OS
3 334455 prod3-Mac 1000 computer 1500-1000
4 445566 prod4-xyz 2000 800 1200 misc
: : : : : : :
: : : : : : :
: : : : : : :
You will enjoy the little help.
Hello
user13667036 wrote:
Oracle: 11 GR 2
Client Windows 7
I have a set of data (the result of a query) which is similar to:
D_rank product_id product_desc category income price cost
1 112233 prod1-iphone phone 200 500 100
1 112233 prod1-iphone4 phone 200 500 100
2 223344 prod2-300 1000 400 windows7 OS
2 223344 prod2-300 1000 400 software windows7
3 334455 prod3-Mac 1000 computer 1500-1000
4 445566 prod4-xyz 2000 800 1200 misc
: : : : : : :
: : : : : : :
: : : : : : :
As you can see the first 4 rows, these rows are repeated due to the product_desc and category material. I have need of these fields but the first value of each subgroup...
...
What does "first" here? What "subgroup"?
Depending on your needs, maybe you want to Request Top - N, something like this:
WITH got_r_num AS
(
SELECT d_rank, product_id, product_desc, category, price, income, cost
ROW_NUMBER () OVER (PARTITION BY d_rank
ORDER BY product_desc, category
) AS r_num
OF data_set
)
SELECT d_rank, product_id, product_desc, category, price, income, cost
OF got_r_num
WHERE r_num = 1
;
I hope that answers your question.
If this isn't the case, please post a small example of data (CREATE TABLE and INSERT statements) and the results desired from these data. (I know you said this is a game of results from a query, and not an array, but the solution is the same as the entry is a single table, or a query, perhaps involvoing several tables.)
Report when the request above is erroneous results and explain, using specific examples, how find you the correct results from these data.
As said ground, see the FAQ in the forum: Re: 2. How can I ask a question on the forums?
-
"BOLD" from the first words of each line?
I wonder if there is a way to fully automate this. I'm style expandable body of interview-format the text, and I would only the first word of each paragraph, be bold if they are one of the three names. I currently have a nested style black the first word of each paragraph, but not all of the paragraphs in the text begin with a name of interview. Can anyone help?
Depends on if you need it to happen automatically when you start new documents with interviews, or if you need to do just for a single doc where all your text has already been sent to. If the latter, I had:
(1) make a duplicate of the nested-style-parastyle called BoldNames
(2) remove the nested style old style paragraph - now zero paragraphs have the nested style applied, and you have a separate unused paragraph with the nested style in style.
(3) research the doc with a GREP query:
To find
^(Jake|) Joel | James)
Implement
$
with the format of
BoldNames
In this way, only the paragraphs that have one of these names at the beginning of the paragraph will be marked with the paragraph style that owns the nested style that applies "BOLD".
-
How the auto uppercase the first letter of each sentence
I use the latest version of the Pages on the Sierra of the OS and I am trying to find a way to automatically capitalize the first letter of each sentence with nothing doesn't. I've been a user of Pages for years and every time announced a new update is all what I care about is adding this feature simple but important. So, now that the new update is here I can not yet understand how to take advantage of the auto and I can't find workarounds online to help me do it. Any idea?
You can use WordService from DEVONtechnologies, free in the Mac App Store. You can then go to System Preferences > keyboard > shortcuts > Services & enable those you want. You can then select the text you want to apply the service to & go to Pages > Services & select initial caps of sentences. It is also possible to assign a keyboard shortcut to services. With the help of this device, or similar functionality in any word processing application still not to revert to words in a sentence that should be capitalized as 'I' or pronunciations. You will also have the problem of it capitalized words after the period for the abbreviation.
I do it the traditional way, using the SHIFT key when necessary. It is advisable to learn to type using the SHIFT key, rather than relying on the software to do it for you. Just like the use of a spellchecker. It's good, but it will not go back on the words that are spelled correctly but not the correct spelling of the situation.
-
OK so I use numbers to design a "schedule" for lack of a better word for a flight instructor course. On the summary page, I need to be able to identify the next sequence of flight for each student. I have a sheet that contains all flights that each student must perform and the date which they filled. So what I need on the summary page is someway to watch flight logs and determine what the next flight is to find the first empty cell under each name of students. I have no idea how to go about that though, so if you have any ideas I would be grateful
Hello j,
Here are two possibilities, both illustrate below. They are independent of each other and can be used alone or together.
If students all sequences in chronological order, and the dates in columns are values of Date and real time, you should be able to locate the first empty line using MATCH and MAX.
Because all dates entered will be 'today' or 'before today', a conditional highlighting rule could be used to color the background of the cell to a cell where a date has been entered.
Table 1 gives the master record. Table 2 shows the following sequence for the student and the line of table 1, which the sequence is listed.
Two formulas are used:
Table 2::B3 and filled with right: = MATCH (MAX (table 1: B), Table 1: B, 0) + 1
Table 2::B2 and filled with right: = OFFSET (table 1: $A$ 1, B3-1, 0)
This method is based on the sequences being completed in the order listed, as it seems the most recent (that is to say date the "bigger").
The rule of conditional formatting applied to all cells in columns B, C and D of table 1 fills every cell that contains a date before the next day with yellow, giving a visual indication of where all the next vacant cell.
This indicator is independent of the order of the sequences, because it depends on only that there is a date or before 'today' in each cell to be highlighted.
Kind regards
Barry
-
To find the first Summit for data channel
Hey guys,.
I need a little help. I wrote a script to process some data. Basically, what the script does is calculate the linear accelerations peak, peak of the angular speeds, HIC values and IF. But there is a problem with my script that I need help. In my script, I use the ChnPeakFind command to find the pics in my chains. This command works fine to find the peak value, but what I want to do is find the FIRST Summit in the data, without worrying whether or not it is a maximum. I always encountered data that varies in which my first pic (impact analysis) may or may not be the highest point in the channel. As you can see in the Graphs.png that I have attached, the ChnPeakFind command found the 2nd Summit (red circle #2) in my chain of angular velocity (ARS resulting). But what I report is the first peak value (red circle #1). I've also attached a screenshot of the section in my code where I calculate the angular velocity. The 'i' in the calculation is just the channel group number. In this case, it is 1. Anyone know how to change the code or have another suggestion how to find the first Summit in a channel without having to stop and go to the tab analysis to manually find the pic?
Thank you!
Hello
If it please see my littl below escript and let me know if this could work for you
Dim oChnResultant
Call Data.Root.Clear)
Call DataFileLoad ("E:\Customer_Examples\01_Head_Impact\Head Impact Data.tdm", "CT", "Load")
Set oChnResultant = data. Root.ActiveChannelGroup.Channels.Add ("Result", DataTypeChnFloat64)
Call ChnXYZAbsValue ("[1] / ARS X","[1] / ARS Y","[1] / ARS Z", oChnResultant)
"Use the filter twice to get rid of the jig
Call ChnSavitzkyGolayFilter (oChnResultant, oChnResultant, 1, 12)
Call ChnSavitzkyGolayFilter (oChnResultant, oChnResultant, 1, 12)
' Delete few maxima to the beginninf of the signal.
Calculate the call ("R = IIF (R)<>
'Research for first peak.
Call ChnPeakFind ("[1] / Time axis","[1]/Resultant","/PeakX","/PeakY",1,"Max.Peaks","Time")
-
How to find the child level for each table in a relational model?
Earthlings,
I need your help, and I know that, "Yes, we can change." Change this thread to a question answered.
So: How to find the child level for each table in a relational model?
I have a database of relacional (9.2), all right?
Tips:. O /* This is a child who makes N references to each of the follow N parent tables (here: three), and so on. */ /↑\ Fks O"O O" <-- level 2 for first table (circle) /↑\ Fks "o"o"o" <-- level 1 for middle table (circle) ↑ Fk "º"
-Each circle represents a table;
-Red no tables have foreign key
-the picture on the front line of tree, for example, a level 3, but when 3 becomes N? How is N? That is the question.
I started to think about the following:
First of all, I need to know how to take the kids:
Thought...select distinct child.table_name child from all_cons_columns father join all_cons_columns child using (owner, position) join (select child.owner, child.constraint_name fk, child.table_name child, child.r_constraint_name pk, father.table_name father from all_constraints father, all_constraints child where child.r_owner = father.owner and child.r_constraint_name = father.constraint_name and father.constraint_type in ('P', 'U') and child.constraint_type = 'R' and child.owner = 'OWNER') aux using (owner) where child.constraint_name = aux.fk and child.table_name = aux.child and father.constraint_name = aux.pk and father.table_name = aux.father;
We will share!
Thanks in advance,
Philips
Published by: BluShadow on April 1st, 2011 15:08
formatting of code and hierarchy for readbilityHave you looked to see if there is a cycle in the graph of dependence? Is there a table that has a foreign key to B and B has a back of A foreign key?
SQL> create table my_emp ( 2 emp_id number primary key, 3 emp_name varchar2(10), 4 manager_id number 5 ); Table created. SQL> ed Wrote file afiedt.buf 1 create table my_mgr ( 2 manager_id number primary key, 3 employee_id number references my_emp( emp_id ), 4 purchasing_authority number 5* ) SQL> / Table created. SQL> alter table my_emp 2 add constraint fk_emp_mgr foreign key( manager_id ) 3 references my_mgr( manager_id ); Table altered. SQL> ed Wrote file afiedt.buf 1 select level lvl, 2 child_table_name, 3 sys_connect_by_path( child_table_name, '/' ) path 4 from (select parent.table_name parent_table_name, 5 parent.constraint_name parent_constraint_name, 6 child.table_name child_table_name, 7 child.constraint_name child_constraint_name 8 from user_constraints parent, 9 user_constraints child 10 where child.constraint_type = 'R' 11 and parent.constraint_type = 'P' 12 and child.r_constraint_name = parent.constraint_name 13 union all 14 select null, 15 null, 16 table_name, 17 constraint_name 18 from user_constraints 19 where constraint_type = 'P') 20 start with child_table_name = 'MY_EMP' 21* connect by prior child_table_name = parent_table_name SQL> / ERROR: ORA-01436: CONNECT BY loop in user data
If you have a cycle, you have some problems.
(1) it is a NOCYCLE keyword does not cause the error, but that probably requires an Oracle version which is not so far off support. I don't think it was available at the time 9.2 but I don't have anything old enough to test on
SQL> ed Wrote file afiedt.buf 1 select level lvl, 2 child_table_name, 3 sys_connect_by_path( child_table_name, '/' ) path 4 from (select parent.table_name parent_table_name, 5 parent.constraint_name parent_constraint_name, 6 child.table_name child_table_name, 7 child.constraint_name child_constraint_name 8 from user_constraints parent, 9 user_constraints child 10 where child.constraint_type = 'R' 11 and parent.constraint_type = 'P' 12 and child.r_constraint_name = parent.constraint_name 13 union all 14 select null, 15 null, 16 table_name, 17 constraint_name 18 from user_constraints 19 where constraint_type = 'P') 20 start with child_table_name = 'MY_EMP' 21* connect by nocycle prior child_table_name = parent_table_name SQL> / LVL CHILD_TABLE_NAME PATH ---------- ------------------------------ -------------------- 1 MY_EMP /MY_EMP 2 MY_MGR /MY_EMP/MY_MGR 1 MY_EMP /MY_EMP 2 MY_MGR /MY_EMP/MY_MGR
(2) If you try to write on a table and all of its constraints in a file and do it in a valid order, the entire solution is probably wrong. It is impossible, for example, to generate the DDL for MY_EMP and MY_DEPT such as all instructions for a table come first, and all the instructions for the other are generated second. So even if NOCYCLE to avoid the error, you would end up with an invalid DDL script. If that's the problem, I would rethink the approach.
-Generate the DDL for all tables without constraint
-Can generate the DDL for all primary key constraints
-Can generate the DDL for all unique key constraints
-Can generate the DDL for all foreign key constraintsThis is not solidarity all the DOF for a given in the file object. But the SQL will be radically simpler writing - there will be no need to even look at the dependency graph.
Justin
-
How to draw a line under the first paragraph
Hello
I am trying to solve a problem: my text field should be divided into two parts, horizontally. First part is intended for a log book, and the second is for the body. I need to divide them visually tracing a line between them. The logic is to take the first paragraph and make a summary. The rest is the body. So I need to be able to get the height of the first paragraph in order to draw the line at the right position. And I will have to adjust its position whenever the user scrolls the text.
Any ideas how to on this subject?
see you soon,
Jan
There is a discussion about the various ways to do it in this thread:
http://forums.Adobe.com/message/3382440#3382440
You will also find the recent message on the blog useful:
http://blogs.Adobe.com/tlf/2011/01/decoration-example.html
-robin
-
How to take advantage of the first letter of each word in Mysql
Hello
I tried to put a large database where visitors have been botched when entering text. The main thing I want to do is to capitalize the first letter of each word in Mysql.
I found the code below in PHP, but it continues to find an error on the TIME line:
<? PHP ini_set ('display_errors, 1');? >
<? php require_once('Connections/maison_connection.php');? >
<? PHP
$result = mysql_query ("SELECT column, id FROM table");
While ($row = {mysql_fetch_array ($result))}
$id = $row ['id'];
$column2 = ucwords ($row ["column"]);
$query2 = "UPDATE table SET column = ' $column2′ WHERE id = '$id" ";
mysql_query ($query2);
}
? >
My table is called mailing list and the column name is called, so I modified the script to do this: but it still shows the same error while:
<? PHP ini_set ('display_errors, 1');? >
<? php require_once('Connections/maison_connection.php');? >
<? PHP
$result = mysql_query ("SELECT name, id FROM mailing list");
While ($row = {mysql_fetch_array ($result))}
$id = $row ['id'];
$Name2 = ucwords ($row ['Name']);
$query2 = "UPDATE LISTSERV SET name = ' $Name2′ WHERE id = '$id" ";
mysql_query ($query2);
}
? >
Any ideas?
The key is to use a multidimensional array. The first time the while loop runs through the database results, $i is 0, so the values are assigned to the $updates [0] ['id'] and $updates [0] ["Name"]. The following becomes $updates [1] ['id'] and $updates [1] ["Name"] and so on.
The loop resets $i to 0, and uses count ($updates) to get the length of the array. It then updates each row by using $updates [0] ["Name"] and $updates [0] ['id'], $updates [1] ["Name"] and $updates [1] ['id'] and so on.
-
SQL - find the minimum value for each separate record...
Hi all
I have a table like this in SQL Server
Date of sale of product
A date
A date
A date
B date of
B date of
C date
C date
C date
I would like to write a query to find the minimum date (i.e. the date
the first sale) for each product
Thus, the expected results would be
Date of sale of product
A date min
B date of min
C date of min
How can I do this using SQL Server?
any help is greatly appreciated!
Thank you!
Product SELECTION, MIN (sale_date)
From your_table
GROUP BY productEtienne
Maybe you are looking for
-
HP Photo Creations: HP Photo Creations
I'm having a problem when trying to install HP Photo Creations. When I try and download and install, it downloads and tries to settle. However, I am then achieved by an error message (error code 80004005:1) stating "unable to complete initialization.
-
Microsoft office powerpoint 2007 KB982158 identied as critical microsoft update fails.
Windows XP Professional SP3 of V2, office microsoft 2003 OS, KB982158 identied by microsoft as a critical update fails when I try to install it. Thanks for giving me a clear my action plan to resolve this abnormal situation. Best regards. Glunais
-
Why defragment reduced my free space on the disk?
I show to have only 10% of free disk space on... VISTA lecteurC. Thought that defragmentation would increase free space, but it reduces. Don't understand why I should only less than 10% free space - I do ot DOWNLOAD music or movies and have very fe
-
I had my router and the network off to bad weather. I run a mono wall and netgear WNDR3400, router. I reactivate them after the storm passes and some how my computer resets to 20 July 2002. My CMOS battery is correct setting of ideas how this could h
-
Printable for deskjet 3050 J611n.
Just connected and set up eprint. There are platelets (such as a calendar) I like to use, but all generate the message: not supported on my printer, when I try to choose for my deskjet 3050 J611n. I just installed this new printer.