text:
Q: Extract content from 1 .txt save to another .txt using bat file @ECHO OFF
SET InFile=nsb.txt
SET OutFile=Output.txt
IF EXIST "%OutFile%" DEL "%OutFile%"
SET TempFile=Temp.txt
IF EXIST "%TempFile%" DEL "%TempFile%"
FOR /F "tokens=*" %%A IN ('FINDSTR /N "wordA" "%InFile%"') DO (
   CALL :RemovePrecedingWordA "%%A"
   FOR /F "tokens=1 delims=:" %%B IN ('ECHO.%%A') DO (
      MORE +%%B "%InFile%"> "%TempFile%"
      FINDSTR /V "wordB" "%TempFile%">> "%OutFile%"
      FOR /F "tokens=*" %%C IN ('FINDSTR "wordB" "%InFile%"') DO (
         CALL :RemoveWordB "%%C"
         IF EXIST "%TempFile%" DEL "%TempFile%"
         GOTO :eof
         )
      )
   )

:RemoveWordB
REM Replace "wordB" with a character that we don't expect in text that we will then use as a delimiter (` in this case)
SET LastLine=%~1
SET LastLine=%LastLine:wordB=`%
FOR /F "tokens=1 delims=`" %%A IN ('ECHO.%LastLine%') DO ECHO.%%A>> "%OutFile%"

GOTO :eof
OK so I found this code and I see how it works, and what it does is what I am looking for, but I don't know how to make sure I'm editing this code to work for my case.
I was wondering if there was a way to extract data based on line code, since every start and end of my content have the same number of lines, if a code can be use to find lets say line 4000 to 4050, next content will start 4051 to 4101, and so on
Thank you for any ideas that will work.

A: @ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION
SET "sourcedir=U:\sourcedir"
SET "destdir=U:\destdir"
SET "filename1=q64237051.txt"

:: remove variables starting #
FOR  /F "delims==" %%a In ('set # 2^>Nul') DO SET "%%a="

set /a #=0

:: construct full base-filename

set "fullname1=%sourcedir%\%filename1%"

:: find all "start of block" line numbers

for /f "delims=:" %%a in ('findstr /n /x "{" "%fullname1%"') do set /a "#x!#!=%%a"&set /a #+=1&set /a "#s!#!=%%a"&set /a "#x!#!=10000+%%a"
:: for information - number of blocks found (#) start line number of block n (#sn) start line number of next block (#xn)
REM set #

for /f "delims=" %%a in ('dir /b /a-d "%sourcedir%\*.txt" ') do if "%%a" neq "%filename1%" (
 rem remove variables starting #M
 FOR  /F "delims==" %%n In ('set #M 2^>Nul') DO SET "%%n="

 rem Find differences between basefile "filename1" and other files; number lines, then extract line numbers.
 (for /f "delims=: " %%n in ('FC /N "%fullname1%" "%sourcedir%\%%a"') do echo %%n|findstr /b /R "[1-9]")>"%destdir%\{"
 rem then record the start line of the blocks within which the line appears
 (
  for /f "usebackq" %%L in ("%destdir%\{") do for /L %%b in (1,1,%#%) do if %%L gtr !#s%%b! if %%L lss !#x%%b! set "#M=!#M! !#s%%b!"
  rem and regurgitate lines in the blocks that start on lines #M
  set /a #L=0
  set "#R="
  for /f "usebackqdelims=" %%L in ("%sourcedir%\%%a") do (
   set /a #L+=1
   if defined #R (
    echo %%L
    if "%%L"=="}," set "#R="
    if "%%L"=="}"  set "#R="
   ) else (
   for %%r in (!#M!) do if %%r==!#L! set "#R=Y"
   if defined #R echo {
   )
  )
 )>"%destdir%\%%~na.diff"
)

GOTO :EOF

You would need to change the settings of sourcedir and destdir to suit your circumstances. The listing uses a setting that suits my system.
I used a file named q64237051.txt containing your data for my testing.
First we must clarify the requirements. I've assumed that a difference file is required containing the entire contents of each {..} block where a difference is found.
So - first establish the directory and filenames required and specify the filename which contains the base against which all differences are to be detected.
In this routine, I use variables starting # for every variable used by the process, so clear out any existing #... (unlikely to be any, but still...) and establish delayedexpansion processing so that !var! can be used within blocks to access the dynamic value of variables.
Look in the base file for all lines "{" by using findstr /n to number the lines found an /x for an exact-match to {. This produces lines of the form linenumber:linedata so use for /f with : as a delimiter to record those line numbers, as #s (starting) and #x (next-starting) line numbers.
The effect can be seen by un-commenting the set # command. Note that # is used as a counter.
So - into the meat of the matter. %%a is set to each filename found in sequence, and we skip the base file. Then we are processing each file "%%a"...
first clear every #M variable.
Next, use fc /n to find the differences. This will produce lines of the format  n:data for the lines of interest and also other lines that can be ignored. get the first token of each line from the fc /n report using spaces and colons as delimiters. The lines of interest will survive the filter of a regular expression "numeric" applied via a findstr with option /b so the match is applied to the beginning of the line. Note that no line number will start 0, so the octal-processing that may otherwise be needed is not required. Put the resultant list of line-numbers-where-a-difference-is-found into a temporary file { (just a filename, nothing magical about it)
Next step is parenthesised to allow all ECHOed output to be gathered into the differences file.
Now process the { file containing the line numbers of all differences (and their immediate neighbours) and see which block each fits into. %#% is the block-count. #M will be built with a space-separated list of the required start-of-block line numbers (and there will be duplicates, but this is of no consequence)
Initialise #L (line number) and #R (regurgitate flag) and process each line in the file %%a.
Increment the line number
if we are regurgitating, echo the line and then clear #R if we have an end-of-block (}, or no doubt })
if not regurgitating, detect whether we are at a line number which matches a start-of-required-block. If so, turn on regurgitation by setting #R non-empty and echo the { at the start of a new block.
done!
Note that the metavariable used in for is case-sensitive. I use upper-case L because lower-case can be confused by some with other characters.

redpajama_set_name: RedPajamaStackExchange


Glasgow born and bread, Scott Gibson smashed onto the stand-up scene in November 2010, quickly establishing himself on the circuit.
A storyteller at heart, Scott Gibson mixes a conversational style with his own unique brand of dark humour. Confidently leading his audience down a path, few dare to tread. This ability to push boundaries and control any room he plays has found Scott in high demand.
Scott was Nominated for a Scottish Variety Award in 2014, along with a residency as Dead Sheep Comedy's MC. With Scott leading the Dead Sheep charge, they would go on to win "Best Small Comedy Club" in Scotland at the 2015 Chortle Awards. This success continued with a place on the prestigious AAA showcase at the Pleasance Courtyard, as part of the Edinburgh Festival Fringe.
Scott Gibson's natural talent has seen him being hand picked to support some of the UK's top comedians. These include Frankie Boyle, Tom Stade, Des Clarke, Gary Little, Kevin Bridges and Daniel Sloss to name a few.
Who knows what is next for the Scotsman.
Scott at the Stand in Glasgow.
Find out how to book Scott Gibson as the humorous speaker for your next event by calling SpeakOut! on 020 8914 8966 or clicking the button below.


text:
YPG and Rebel Forces Challenge ISIS in Northern Syria
By Joseph Sax
An important instance of unity among counter-ISIS forces has emerged in Northern Syria, possibly galvanized by recent effective operations against ISIS in Iraq by local Iraqi forces with the support of U.S. airstrikes. The Kurdish YPG, Jabhat al-Akrad [The Kurdish Front], and numerous FSA-affiliated rebel groups announced the formation of the "Euphrates Volcano" joint operations room in Northern Aleppo and Raqqa Provinces on September 10, the most significant rebel-YPG coordination to date. The video statement announcing the formation of the operations room declared the intent liberate to Qarah Qawzaq, Sireen, and Jarablus in addition to Manbij, Raqqa, and their surroundings, and called for material support from the international community in the fight against ISIS. The joint force appears to have immediately initiated operations against ISIS, claiming responsibility for a VBIED targeting an ISIS vehicle in the village of Qarah Qawzaq in the northeastern Aleppo countryside on September 11. A second VBIED in the ISIS-held city of Tabqa west of Raqqa went unclaimed, but is likely to have been conducted by groups within the operations room.
The formation of a joint Arab-Kurdish operations room against ISIS in Northern Syria is a significant inflection that is likely to force a shift in ISIS's calculus. Significantly, the YPG is also involved in the fight against ISIS near Azaz, where a rebel coalition including FSA groups, Jabhat al-Akrad, Jabhat al-Nusra (JN), and Islamic Front groups appear to have been initially successful in blunting the momentum of ISIS's advance against a key rebel supply line near the Turkish border. Furthermore, in Hasaka province, the YPG has made a number of recent gains against ISIS. The YPG successfully recaptured the town of Jaza'a near the Iraqi border, which had been seized by ISIS forces on August 19. In addition, a YPG offensive against the ISIS stronghold of Tel Hamis is currently underway, and initial reports indicate a successful advance by the YPG.
The Euphrates Volcano Joint Operations Room is an important case study for how the rebel landscape in a given area can be expected to interact with U.S. airstrikes against ISIS in Syria, if such airstrikes are to be conducted. Airstrikes alone are unlikely to be successful in defeating ISIS. However, it is possible that rebel action against ISIS on the ground may make considerable gains while ISIS forces are under pressure. While it is too early to examine the battlefield effectiveness of this joint Kurdish-Rebel force, clashes between the YPG and ISIS in the summer of 2014 provide a crucial lens into the force the YPG is able to bring to bear as a member of the new alliance. While they have taken notable losses, YPG forces have consistently been successful in resisting ISIS advances. Furthermore, activity in the months preceding the formation of the operations room sheds light on how ISIS is likely to perceive this new threat to its "border." An instance of cooperation between YPG rebel forces against ISIS in Northern Syria in March provoked immediate aggression from ISIS, which moved quickly to reassert its control over its own critical terrain.
Background: the Syrian Kurdish Dynamic
The Syrian Civil War placed Syrian Kurds in a position of both extreme risk and unprecedented opportunity. Taking advantage of the regime's decreasing control, Kurdish leaders from the Democratic Union Party (PYD) formed an armed wing titled the People's Protection Units (YPG) with the intent of securing control of predominantly ethnic Kurdish areas in Northern and Eastern Syria. Throughout 2012, the PYD assumed administrative and military control over large parts of northern and northeastern Syria. However, the PYD continued to cooperate locally with the Syrian regime, and YPG forces have shared joint control with the regime over Qamishli and Hasaka cities. As a result of this cooperation, Islamist and rebel groups in Eastern Syria frequently clashed with the YPG, including prominent advances by JN, Islamist rebel groups, and ISIS deep into Hasaka province in early 2013.
In a highly successful operation titled the Serekeniye Martyrs' Offensive, YPG forces expelled JN and ISIS forces from the border town of Ras al-Ayn and its surrounding countryside in July 2013. During these clashes, the YPG proved itself to be a capable fighting force able to evict coalitions of rebel groups from predominantly Kurdish territory. The success of the offensive was closely followed by PYD's declaration of the Self-Rule Transitional Government, which conferred de-facto autonomy to the Kurdish-majority "cantons" of Afrin and Kobane, in Aleppo province, and Jazira, in Hasaka province.
Fighting between rebel forces and the YPG also occurred in northern Aleppo province. In August of 2013, a coalition of Syrian groups including ISIS, Ahrar al-Sham, Suqour al-Sham, Liwa al-Tawhid, and local groups from the town of Shuyukh announced that they were placing Ayn al-Arab under siege "to liberate the highway between Manbij and Hasaka from PKK [a derogatory reference to Kurdish forces by groups hostile to the YPG] checkpoints." Nevertheless, rebel forces and the YPG were brought in alignment against ISIS in Northern Syria in the aftermath of the counter-ISIS offensive in January 2014 spearheaded by the Syrian Revolutionaries Front.
YPG support for rebels in Aleppo provokes ISIS containment operations
In the Spring of 2014, ISIS escalated hostilities against the YPG in northeastern Aleppo Province. The timing, geographical distribution, and intensity of ISIS attacks indicate three ISIS objectives. First, ISIS wanted to push back YPG positions in order to establish a buffer zone between the YPG's area of free movement and the "borders" of ISIS's infant Aleppo Wilayat [Governorate]. Second, ISIS sought to protect key terrain essential to the congruity of ISIS territory in Syria; specifically, the towns of Sarrin, Zawr Maghar, and Upper and Lower Shuyukh. Finally, ISIS sought to deter future YPG aggression against potential ISIS vulnerabilities surrounding the canton of Kobane.
A decision by the YPG to join an attack by the Euphrates Islamic Liberation Front against the ISIS stronghold of Sarrin on March 14 appears to have provoked a shift in ISIS's disposition toward the YPG and is likely to have encouraged the subsequent ISIS assault against the YPG in Northern Aleppo province. ISIS had seized the towns of Sarrin and Shuyukh Fawqani in the southernmost outskirts of the Kobane canton on March 10 and 11 respectively, allowing it to secure two major crossings north of the Euphrates and more effectively link its control zone north of Aleppo to those in northern Raqqa province. A strategically located town, Sarrin provides access to the Qarah Qozaq bridge and is therefore critical to ISIS's freedom of mobility in the area. Wresting the bridge from ISIS control would have allowed the YPG and other rebel groups to cut an ISIS ground line of communication (GLOC) between Manbij and Tel Abyad, forcing ISIS to rely on a circuitous route south through the contested Tishrin Dam region.
By participating in the attack, the YPG proved it posed a threat to the not-yet-hardened periphery of ISIS's Aleppo region. In response, ISIS forces launched an offensive operation to force a contraction of the YPG's area of operations and deter future aggression. According to Kurdish news site Welati, 700 ISIS fighters arrived in Sireen on March 18 after further clashes erupted between ISIS and YPG-backed rebels. On March 19, the YPG Central Command announced a general mobilization on its website, indicating that reinforcements from other cantons would be moved to Kobane to assist against "inhuman attacks from the ISIS gang." Shortly thereafter, during Friday prayers on March 21, ISIS-affiliated preachers in Raqqa province declared Ayn al-Arab to be "inside ISIS's borders."
Likely seeking to relieve pressure near Sireen, ISIS forces based near Tel Abyad on the Turkish border in northern Raqqa province opened a second front against YPG forces in Kobane. As clashes west of Tel Abyad continued on March 29, ISIS launched its first of three nighttime raids on the town of Zawr Maghar, located just east of Jarablus on the Turkish border. A second attack on Zawr Maghar on April 3 prompted an alarmed statement from the PYD, calling the attacks "the most violent since ISIS began its siege on Kobane." A third nighttime raid, rumored to have been staged from Khirab Ato, against Zawr Maghar was reported by the YPG on April 17 amidst continued ISIS shelling in eastern Kobane, the last major ISIS operation in the initial ISIS effort to encircle and contain the canton of Kobane in 2014.
Reports of ISIS-YPG clashes in Kobane largely died down in early April, with local sources claiming the ISIS offensive had been thwarted. A YPG commander declared on April 19 that ISIS "not in a condition to advance now" and had been "entirely broken." Overall, ISIS forces had been able to secure the valuable Qarah Qozaq bridge, but failed to decisively punish and deter the YPG. In fact, the YPG announced "a new resistance campaign against attacks" on April 25, launching immediate attacks against ISIS southwest of Ayn al-Arab city. More importantly, the YPG continued to support rebel groups fighting ISIS in Sarrin as late as May 1, clearly demonstrating ISIS' failure to contain the YPG and prevent it from threatening critical lines of communication. By the beginning of May, the only ISIS aggression reported in Kobane were isolated firefights along front-line positions, other than ISIS' brief capture of a hill that was reportedly quickly retaken by the YPG.
After failing in its first attempt to deter the YPG through direct military action, ISIS changed tactics, launching a wave of kidnappings targeting the Kobane canton as well as groups of Kurdish civilians travelling through Aleppo province. On May 21, ISIS fighters abducted 15 Kurdish civilians from the town of Kun Eftar, located along the road between Shuyukh at Sarrin and reported to have been on the frontline between the YPG and ISIS. ISIS's kidnapping campaign expanded significantly in late May, with ISIS fighters kidnapping 200 Kurds from the town of Qabasin in Aleppo province on May 30. It is possible that ISIS conducted these kidnappings with the intent of conducting swaps for captured fighters and remains. YPG spokesman Redur Xelil confirmed in an interview with McClatchy on June 21 that the YPG was "waiting for their demands to determine if there should be a prisoner swap." Additionally, Kurdish journalist Multu Civiroglu suggested in an email sent to McClatchy DC that ISIS hoped to use the captured students as a "bargaining chip to pressure YPG." However, it is also possible the attacks were simply punitive. The Guardian reported that over the following months ISIS tried to "brainwash" the captives and induct them into ISIS ranks, sparking intense fear within the Kurdish population.
A second ISIS offensive against western Kobane began in late June. On June 23, the YPG and Kurdish media reported a renewed ISIS ground offensive on Zawr Maghar. On July 3, ISIS finally succeeded in capturing Zawr Maghar, which had been the target of ISIS attacks since March. A YPG statement published on July 4 announced the YPG's withdrawal from Zawr Maghar, Bayadi, and Ziyara, temporarily granting ISIS a buffer zone. In addition to denying the YPG the ability to target Jarablus with indirect fire, the capture of Zawr Maghar allowed ISIS to broaden its offensive against the YPG, paving the way for ISIS's capture of Bayadiya on July 6. Similar to its previous attacks on Kobane, ISIS opened a second front against the YPG staged from northern Raqqa. On July 8, ISIS attacked a YPG cordon around the village of Abdi Kuwi, east of Ayn al-Arab along the Turkish border, and detonated a VBIED against a YPG checkpoint at a cement factory on the road between Sireen and Ayn Issa. This ISIS front appears to have been successful, and the YPG released an official admission on July 9 that its forces had withdrawn from the villages of Kiri Sor, Afdouki, and Kendal as ISIS claimed to have broken the YPG siege of Abdi Kuwi following massive bombardment with tanks and artillery.
However, YPG resistance continued. According to ARANews, the YPG recaptured Jubb al-Faraj, east of Shuyukh Fawqani, and Khirab Ato by July 6.. On July 11, the YPG announced an attack on ISIS-controlled Shuyukh Tahtani, situated along the road linking the key ISIS bridgeheads of Shuyukh Fawqani and Sireen. In mid-July, reports surfaced indicating that the PYD in the Hasaka "Jazira" canton had begun debating instituting compulsory service in the YPG, possibly for purposes of redeployment to Ayn al-Arab. However, the proposed law never came to a vote,, and instead upwards of 800 Turkish Kurds arrived from PKK training camps in Turkey to join the YPG's fight against ISIS in mid-July. ISIS captured the village of Fiyunta in Eastern Kobane from the YPG two days after the arrival of the PKK reinforcements, but the fresh forces allowed the YPG to stabilize their defenses and begin to push ISIS forces back. On the western front, the YPG halted ISIS's advance at the town of Jebneh, east of Bayadiya. By July 23, the YPG had recaptured the towns of Jel Oghlu and Darbazin, and took Katsh, Jabb al-Faraj and Kjel a week later, giving the YPG the positioning needed to attack the town of Shuyukh.
The YPG attack on Shuyukh Tahtani was the climactic moment of the Kobane campagin. During the attack, 14 YPG and 35 ISIS fighters were reportedly killed in about 12 hours of fighting. The YPG did not take control of the town, but the takeaway was clear: the YPG could still place significant pressure on the Jarablus-Sireen GLOC and compel ISIS forces in Jarablus to detour around the Shuyukh Fawqani bridge. While sporadic clashes continued through August, these occurred on a much smaller scale with no major territories changing hands. By the beginning of September, ISIS had decisively accomplished one of its primary objectives and decidedly failed in the other two: ISIS had captured Zawr Maghar, pushed the YPG back from Sireen, and held onto Shuyukh, demonstrating ISIS' ability to secure certain critical locations on the eastern border of its declared Aleppo region. ISIS failed, however, to create a buffer zone around Shuyukh or Zawr Maghar that would preclude subsequent YPG penetration into ISIS territory.
Analysis of the Kobane fight in the summer of 2014 reveals important aspects of ISIS strategy in Syria, indicative of an ISIS prioritization of continuity between its Syrian territories. It is clear that ISIS perceived the YPG to be a threat to important lines of communication that run close to the canton's borders, and was willing to make a concerted effort to contract the YPG's area of operations. ISIS specifically mentioned the proximity of Zawr Magharto the city of Jarablus in a report it published on the attack, confirming that ISIS considered YPG control of the town to be an untenable threat to the borders of its declared Aleppo region. The failure of the first phase of the offensive in March and April revealed that ISIS' forces in the area lacked the strength to consistently make significant gains against the YPG. However, after the Mosul offensive in early June, newly strengthened ISIS forces made important gains, inducing panic in the Kurdish canton. This increased ISIS strength was likely the result of newly acquired indirect fire capabilities acquired from weapons depots in Mosul, and possibly the deployment of veteran fighters to supplement those based in the Aleppo area. The ISIS attack on Zawr Maghar began with days of sustained indirect fire bombardment, distinguished from previous attacks that had almost exclusively consisted of nighttime raids. Testament to this inflection, a YPG statement published on July 4 claimed that ISIS fired over three thousand mortar shells at the town. While the veracity of this claim is impossible to verify, the extent of ISIS's weapons seizures in Iraq has been well documented.
Despite the reinvigoration of ISIS forces, the YPG was largely successful in defending its border against ISIS. The summer offensives therefore exhibit the ability of the YPG to resist ISIS gains, and to challenge the ISIS interior in a meaningful way. Newly united with rebel groups against ISIS within the Euphrates Volcano Operations Room, YPG forces are likely to contribute both effective fighters and critical staging capabilities that may lead to success against ISIS in the province. The joint operations room is a critical indicator of the possibilities for the formation of local counter-ISIS coalitions within Syria, and, if effective, may provide much-needed rebel momentum within the province. While insufficient to defeat ISIS, effective counter-ISIS action in Northern Syria may nonetheless encourage further exploration of local counter-ISIS alliances throughout Syria. However, the YPG's participation has once again provoked a strong ISIS response. At the time of writing, an ISIS offensive against the Kobane canton has commenced and made sweeping initial gains. Thus the recent dynamics in Northern Syria illustrate that counter-ISIS movements face high risk in the short-term, and are likely to require additional assistance to be successful in resisting ISIS aggression.
Labels: Ar-raqqa, Syria, Tabqa, VBIED, YPG
Iraq Situation Report: September 29, 2014
Iraq Situation Report: September 27-28, 2014
ISIS Ramps Up Activity in Northwestern Baghdad
Syria Update: September 12-19, 2014
Warning Intelligence Update: ISIS Attacks Baghdad
Jabhat al-Nusra Regroups after ISIS Success in Iraq
Control of Terrain in Iraq: September 17, 2014
The Iraqi Shi'a Militia Response to the U.S. Anti-...
Syria Update: September 4-12, 2014
Iraq Situation Report: September 9-11, 2014
Control of Terrain in Syria: September 11, 2014
ISIS Sanctuary Map: September 10, 2014
Iraq Situation Report: September 8-9, 2014
Iraq Forms a Government without Defense or Interior
Syria Update: August 30-September 4, 2014
Control of Terrain in Iraq: September 2, 2014

redpajama_set_name: RedPajamaCommonCrawl


...because it's showing up for multiple separate accounts tested multiple times, each of which can log on perfectly well to other machines in the domain, including Windows 10 machines.
dcdiag shows no errors with the domain.
network connectivity between the workstation and the DC is fine.
testing the secure channel shows it to be up and working.
the workstation applies group policy, installs software configured in group policy, etc.
most confusingly of all, the users can be logged in when I connect to the machine using enter-pssession; just not when logging in on console or through Remote Desktop.
So given all that - what's left?
Additional: another machine installed with the same Windows 10 setup later does work, so it seems to be client-specific.
Additional additional: Starting with an installation of Windows 8.1, adding that to the domain, and then upgrading it to this version of Windows 10 does work.
Browse other questions tagged windows active-directory login windows-10 or ask your own question.
What would cause a domain user password change to take 30 minutes?
What can I do to fix missing start menu/desktop icons for a domain user?
How can I view information for domain groups from the command line with just core Windows utilities?


Phoenix (/ˈfiːnɪks/; O'odham: S-ki:kigk; Yavapai: Wathinka or Wakatehe; Western Apache: Fiinigis; Navajo: Hoozdoh; Mojave: Hachpa 'Anya Nyava) is the capital, and largest city, of the U.S. state of Arizona. With 1,445,632 people (as of the 2010 U.S. Census), Phoenix is the most populous state capital in the United States, as well as the sixth most populous city nationally, after (in order) New York, Los Angeles, Chicago, Houston, and Philadelphia. Residents of the city are known as Phoenicians.
The anchor of the Phoenix metropolitan area (also known as the Valley of the Sun, a part of the Salt River Valley), it is the 13th largest metro area by population in the United States with approximately 4.3 million people in 2010. In addition, Phoenix is the county seat of Maricopa County and is one of the largest cities in the United States by land area.
The population growth rate of the Phoenix metro area has been nearly 4% per year for the past 40 years. While that growth rate slowed during the Great Recession, it has already begun to rebound. Currently ranked 6th in population, it is predicted that Phoenix will rank 4th by 2020. Being near the center of the state, Phoenix is the jumping off point for the various attractions in the Valley of the Sun, as well as the rest of Arizona.
Phoenix is in the southwestern United States, in the south-central portion of Arizona, and about halfway between Tucson to the south and Flagstaff to the north. The metropolitan area is known as the "Valley of the Sun", due to its location in the Salt River Valley. It lies at a mean elevation of 1,117 feet (340 m), in the northern reaches of the Sonoran Desert.
Other than the mountains in and around the city, the topography of Phoenix is generally flat, allowing the city's main streets to run on a precise grid with wide, open-spaced roadways. Scattered, low mountain ranges surround the valley: McDowell Mountains to the northeast, the White Tank Mountains to the west, the Superstition Mountains far to the east, and the Sierra Estrella to the southwest. On the outskirts of Phoenix are large fields of irrigated cropland and several Indian reservations. The Salt River runs westward through the city of Phoenix, and the riverbed is often dry or contains a little water due to large irrigation diversions. The community of Ahwatukee is separated from the rest of the city by South Mountain.
Since 1979, the City of Phoenix has been divided into urban villages, many of which are based upon historically significant neighborhoods and communities that have since been annexed into Phoenix. Each village has a planning committee that is appointed directly by the city council. According to the village planning handbook issued by the city, the purpose of the village planning committees is to work with the city's planning commission to ensure a balance of housing and employment in each village, concentrate development at identified village cores, and to promote the unique character and identity of the villages.
Phoenix has a subtropical desert climate (Köppen: BWh), typical of the Sonoran Desert in which it lies. Phoenix has extremely hot summers and warm winters. The average summer high temperatures are some of the hottest of any major city in the United States, and approach those of cities such as Riyadh and Baghdad. The temperature reaches and exceeds 100 °F (38 °C), on average over 92 days each year, including most days from late May through early October. Highs top 110 °F (43 °C) an average of 18 days during the year The longest stretch of continuous 100 degree days is 76, from June 10 – August 24, 1993. The greatest number of 100 degree days in a year in Phoenix history is 143 (1989), while the fewest is 48 (1913). For comparison, New York City has had a total of 59 days of 100 degree weather since 1870. On June 26, 1990, the temperature reached an all-time recorded high of 122 °F (50 °C).
Most deserts undergo drastic fluctuations between day and nighttime temperatures, but not Phoenix due to the heat sink effect. As the city has expanded, average summer low temps have been rising steadily. The daily heat of the sun is stored in pavement, sidewalks and buildings, and is radiated back out at night. Overnight lows greater than 80 °F (27 °C) occur frequently each summer, with the average July low being 81 °F (27 °C), and the average August low being 80 °F (27 °C). On average, 67 days throughout the year will see the nighttime low at or above 80 °F (27 °C). The highest low temperature recorded in Phoenix was 96 °F (36 °C), which occurred on July 15, 2003.
Phoenix is the sixth most populous city in the United States according to the 2010 United States Census, with a population of 1,445,632, making it the most populous state capital in the United States. Phoenix's ranking as the sixth most populous city was a drop from the number five position it had held since the U. S. Census Bureau released population estimates on June 28, 2007. Those statistics used data from 2006, which showed Phoenix's population at 1,512,986, which put it just ahead of Philadelphia. The 2010 Census, while showing an overall increase from the official 2000 Census showed a drop in Phoenix' population from the 2007 estimates, allowing Philadelphia to regain the fifth spot.
After leading the nation in population growth for over a decade, the sub-prime mortgage crisis, followed by the recession, led to a slowing in the growth of Phoenix. The Phoenix metropolitan area's net population growth was estimated at around 77,000 in 2009, down from a peak of about 162,000 in 2006. Despite this slowing, Phoenix's population grew by 9.4% since the 2000 census (a total of 124,000 people), while the entire Phoenix metropolitan area grew by 28.9% during the same period. The 124,000 gain was the smallest of any census period since 1940–50, when the city's entire population was 107,000 residents, and that 9.4% was the lowest percentage increase rate since the 1880–90 census period. The city of Phoenix captured 13% of the metropolitan growth, down from 33% in the 1990–2000 census period.
The Phoenix Metropolitan Statistical Area (MSA) (officially known as the Phoenix-Mesa-Glendale MSA), is one of 10 MSA's in Arizona, and is the 13th largest in the United States, with a total population of 4,192,887 as of the 2010 Census. Consisting of parts of both Pinal and Maricopa counties, the MSA accounts for 65.5% of the total population of the state of Arizona. Phoenix is also part of the Arizona Sun Corridor megaregion (MR), which is the 10th most populous of the 11 MRs, and the 8th largest by area. It had the 2nd largest growth by percentage of the MRs (behind only the Gulf Coast MR) between 2000 and 2010.
The population is almost equally split between men and women, with men making up 50.2% of city's citizens. The population density is 2,797.8 people per square mile, and the median age of the city is 32.2 years, with only 10.9 of the population being over 62. 98.5% of Phoenix's population lives in households with an average household size of 2.77 people. There were 514,806 total households, with 64.2% of those households consisting of families: 42.3% married couples, 7% with an unmarried male as head of household, and 14.9% with an unmarried female as head of household. 33.6% of those households have children below the age of 18. Of the 35.8% of non-family households, 27.1% of them have a householder living alone, almost evenly split between men and women, with women having 13.7% and men occupying 13.5%. Phoenix has 590,149 housing units, with an occupancy rate of 87.2%. The largest segment of vacancies is in the rental market, where the vacancy rate is 14.9%, and 51% of all vacancies are in rentals. Vacant houses for sale only make up 17.7% of the vacancies, with the rest being split among vacation properties and other various reasons.